How to make a two line complex plot title
7 views (last 30 days)
Show older comments
Hi,
I have a script that performs certain calculations and plot results into graphs. I want to make the title of the graph into 2 lines. Here is the code for setting the title. Could you please tell me how to make it into new line?
title (['Outputs' here I want a new line get(handles.editSampleID,'String' ... '^{T' num2str(a) '}_{' sprintf('%0.2g', str2num(get(handles.editL,'String'))*1e6) '\mum' ])
I include a sample name into the title, plus the value of a parameter called L... I just want to separate these values from the title "Outputs".
Thanks in advance!
G.
0 Comments
Answers (1)
Voss
on 2 Jan 2024
Edited: Voss
on 2 Jan 2024
% using these since I don't want to make uicontrols:
handles_editSampleID_String = '45';
handles_editL_String = '0.00002';
% some value for a as well:
a = 9;
One way:
title (['Outputs' newline() handles_editSampleID_String ...
'^{T' num2str(a) '}_{' sprintf('%0.2g', str2num(handles_editL_String)*1e6) '}\mum' ])
Another way:
title ({'Outputs', [handles_editSampleID_String ...
'^{T' num2str(a) '}_{' sprintf('%0.2g', str2num(handles_editL_String)*1e6) '}\mum' ]})
0 Comments
See Also
Categories
Find more on Title in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!