How to modify title (size or position)?

조회 수: 180 (최근 30일)
Allan N
Allan N 2013년 5월 10일
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!

채택된 답변

Image Analyst
Image Analyst 2013년 5월 10일
편집: Image Analyst 2013년 5월 10일
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
Allan N
Allan N 2013년 5월 10일
This worked great! Thanks for the help :).

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 10일
title({'May 10';' Run 6 | MN'});

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by