Set aspect ratio of stacked plot
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Eric Roden
am 11 Nov. 2023
Beantwortet: Dyuman Joshi
am 11 Nov. 2023
Dear colleagues:
I have been searching through the help menus to try to figure out how to set the aspect ratio of a stacked plot, with no success. Can someone share the coding required to do this?
Many thanks, Eric
Eric Roden
Professor of Geoscience
University of Wisconsin-Madison
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 11 Nov. 2023
You can change the (inner) position of the stacked plot - https://in.mathworks.com/help/matlab/ref/matlab.graphics.chart.stackedlinechart-properties.html#mw_9c083e4b-17d1-41fa-85ff-99906ce25d7d
The values in the Position property correspond to [left bottom width height] and the default unit is normalized, w.r.t the whole figure i.e. lower left corner maps to (0,0) and top right corner maps to (1,1)
tbl = readtimetable("outages.csv","TextType","string");
tbl = sortrows(tbl);
figure
h1=stackedplot(tbl);
%Default position values
h1.Position
figure
h2 = stackedplot(tbl);
AR = 1.5;
width = 0.6;
%Modified values
h2.Position = [0.2 0.1 width AR*width];
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations 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!

