Add subtitle to the plot?
94 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lee
am 28 Jul. 2022
Bearbeitet: Adam Danz
am 10 Apr. 2024 um 17:00
Adding subtitle to the plot but I have error?
can anyone tell me why this msg apperaed
2 Kommentare
Akzeptierte Antwort
Adam Danz
am 28 Jul. 2022
Bearbeitet: Adam Danz
am 10 Apr. 2024 um 17:00
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 Kommentare
Adam Danz
am 28 Jul. 2022
Bearbeitet: Adam Danz
am 28 Jul. 2022
Oh, I see.
Start here in the documentation: tiledlayout
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!