graph subtitle?

조회 수: 4 (최근 30일)
tombola
tombola 2011년 12월 12일
답변: Adam Danz 2020년 9월 22일
Hi, is there a way to add a subtitle to a graph / plot?
So, for example the graph has a title above it like "UK Yield", then underneath it a subtitle "Data from ...somecompany...".
I keep seeing references to a subtitle.m on the file exchange but when I click the link the file is no longer available.
Thanks for any help,
Tom
[EDITED, Jan Simon]
Is there any way to get the 'Data from...' title underneath the graph. Like a small subtitle?
  댓글 수: 1
Jan
Jan 2011년 12월 12일
Copied from Answers section:
Daniel wrote: Can you draw a figure that shows what you mean?

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

답변 (2개)

Daniel Shub
Daniel Shub 2011년 12월 12일
title({'UK Yield', 'Data from ...somecompany...'})
or maybe
title('UK Yield')
xlabel('Data from ...somecompany...')

Adam Danz
Adam Danz 2020년 9월 22일
Starting in r2020b, you can add a title and subtitle using
[t,s]=title('myTitle','mySubtitle')
or
t = title('myTitle');
s = subtitle('mySubtitle');
Alternatives prior to r2020b:
figure
h = subplot(1,2,1);
formattedText = {'\fontsize{12}\color{black}\bfTitle1'; '\fontsize{8}\color{gray}\rmTitle2'};
% _______ _______
% title subtitle
h = title(h, formattedText);
% or more simply
h = subplot(1,2,2);
title(sprintf('Title1\nSubtitle1'))

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by