Adding subtitle to the plot but I have error?
can anyone tell me why this msg apperaed

댓글 수: 2

Lee
Lee 2022년 7월 28일
yes thanks , but also when I corrected the graph appeared without subtitle
so what can I do
Rochelle
Rochelle 2024년 4월 9일
Try the function subtitle() instead.

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

 채택된 답변

Adam Danz
Adam Danz 2022년 7월 28일
편집: Adam Danz 2024년 4월 10일

0 개 추천

If you're using MATLAB R2020b or later, use the subtitle function.
If you're using MATLAB prior to that release, you could add a second row to your title using
title({'main','secondary'})
Your error message mentioned "suptitle" suptitle used to be a function in the Bioinformatics Toolbox. It created a super-title over a group of subplot. That can be acheived using in modern Matlab by adding the title to a TiledChartLayout object. Also see example in the documentation.
figure()
tcl = tiledlayout('flow');
nexttile; nexttile; nexttile; nexttile;
title(tcl, 'Super title')

댓글 수: 5

Lee
Lee 2022년 7월 28일
thanks dear, but how can I use TiledLayout.
Adam Danz
Adam Danz 2022년 7월 28일
My answer shows an example. Are you having a specific problem with TiledLayout?
Lee
Lee 2022년 7월 28일
no but I didnt know what it is, I am new in MATLAB
Adam Danz
Adam Danz 2022년 7월 28일
편집: Adam Danz 2022년 7월 28일
Oh, I see.
Start here in the documentation: tiledlayout
I also recommend doing the Matlab Onramp to get you started in Matlab.
Here's an example with comments. Run each line individually to understand the process.
figure; % creates a new figure
tcl = tiledlayout(2,3); % Specifies a 2x3 grid of tiles
nexttile % Creates the first
plot(rand(1,20)) % plots random values in first tile
nexttile % creates the second tile
plot(rand(1,20)) % plots random values.
nexttile
plot(rand(1,20))
nexttile
plot(rand(1,20))
nexttile
plot(rand(1,20))
nexttile
plot(rand(1,20))
title(tcl, 'My Super Tile') % assigns the title to the entire tiledChartLayout object
Lee
Lee 2022년 7월 28일
Oh my dear , I really appreciate that.
Big thanks

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

Lee
2022년 7월 28일

편집:

2024년 4월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by