How to modify title (size or position)?

202 Ansichten (letzte 30 Tage)
Allan N
Allan N am 10 Mai 2013
I'm new to Matlab and am working off a previously set up template. I'm having difficulties with my title. The template is set up so that four different views are saved and the title is floating. When I print the graphs it cuts off half of the title. Is there a way to either shrink the size of the text or to move it down to fix to the problem?
Below is the current code. How would I modify it to fix this problem?
title({'May 10, Run 6 | MN'});
ylabel('Temperature (K)')
xlabel('\lambda (nm)')
zlabel('Counts')
axis([300 550 110 350])
Thank you for your help!

Akzeptierte Antwort

Image Analyst
Image Analyst am 10 Mai 2013
Bearbeitet: Image Analyst am 10 Mai 2013
You didn't post a screenshot, so I'm not sure what the problem is, but try this code:
fontSize = 14; % Whatever you want.
caption = sprintf('May 10, Run 6\nMN');
title(caption, 'FontSize', fontSize);
ylabel('Temperature (K)', 'FontSize', fontSize)
xlabel('\lambda (nm)', 'FontSize', fontSize)
zlabel('Counts', 'FontSize', fontSize)
axis([300 550 110 350])
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
When you create the string, such as caption like I did, put in a backslash n wherever you want it to go to the next line.
  1 Kommentar
Allan N
Allan N am 10 Mai 2013
This worked great! Thanks for the help :).

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 10 Mai 2013
title({'May 10';' Run 6 | MN'});

Kategorien

Mehr zu Numeric Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by