stacked plots with contour- custom lsyout

2 次查看(过去 30 天)
How might I produce sumething like this?

回答(1 个)

Star Strider
Star Strider 2023-7-3
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.
.

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by