stacked plots with contour- custom lsyout

2 Ansichten (letzte 30 Tage)
HC98
HC98 am 3 Jul. 2023
Beantwortet: Star Strider am 3 Jul. 2023
How might I produce sumething like this?

Antworten (1)

Star Strider
Star Strider am 3 Jul. 2023
It is likely easiest to use subplot because it allows more options for the axis sizing, while the others (tiledlayout and stackedplot) do not. Much depends on what ‘Plot 1’ and ‘Plot 3’ are, and if the arrows are necessary (they could be difficult, since they are outside of any axes).
Otherwise —
figure
subplot(4,1,1)
plot(rand(10,1))
axpos = get(gca,'Position');
set(gca, 'Position',axpos+[0 0 -0.03 0]);
subplot(4,1,[2 3])
contourf(rand(5))
colormap(turbo)
hcb = colorbar;
cbpos = hcb.Position;
axpos = get(gca,'Position');
set(gca, 'Position',axpos+[0 0 0.1 0]);
subplot(4,1,4)
plot(rand(10,1))
axpos = get(gca,'Position');
set(gca, 'Position',axpos+[0 0 -0.03 0]);
It would be necessary to tweak the 'Position' vector values, however that is not difficult although it could be a bit exasperating to get everything working correctly. One potential problem is to be certain all this fits inside the enclosing figure position so that nothing gets cut off, so that might need to be modified as well.
This should get you started.
.

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by