How to make a two line complex plot title
7 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Voss
2024-1-2
编辑:Voss
2024-1-2
% 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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Title 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
