How to make a two line complex plot title
6 ビュー (過去 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!
