How to modify title (size or position)?

199 vues (au cours des 30 derniers jours)
Allan N
Allan N le 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!

Réponse acceptée

Image Analyst
Image Analyst le 10 Mai 2013
Modifié(e) : Image Analyst le 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 commentaire
Allan N
Allan N le 10 Mai 2013
This worked great! Thanks for the help :).

Connectez-vous pour commenter.

Plus de réponses (1)

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

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by