Add subtitle to the plot?

96 次查看(过去 30 天)
Lee
Lee 2022-7-28
编辑: Adam Danz 2024-4-10,17:00
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,4:25
Try the function subtitle() instead.

请先登录,再进行评论。

采纳的回答

Adam Danz
Adam Danz 2022-7-28
编辑:Adam Danz 2024-4-10,17:00
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 个评论
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 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by