How to make a two line complex plot title

7 visualizaciones (últimos 30 días)
Georgi
Georgi el 9 de Mzo. de 2017
Editada: Voss el 2 de En. de 2024
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.

Respuestas (1)

Voss
Voss el 2 de En. de 2024
Editada: Voss el 2 de En. de 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' ]})

Categorías

Más información sobre Title en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by