Filter löschen
Filter löschen

how to plot subfigures in one figure like this image?

2 Ansichten (letzte 30 Tage)
MatlabUser
MatlabUser am 24 Feb. 2023
Kommentiert: Jan am 24 Feb. 2023
Hello,
I have two images that I would like to plot them next to each other, however for each image there are two small portions horizontal and vertical around them (images as well)
how can I plot them to be like this images?
  3 Kommentare
MatlabUser
MatlabUser am 24 Feb. 2023
Bearbeitet: MatlabUser am 24 Feb. 2023
yesso total 6 images @Rajeev but for example the green has the same height for blue and the gray same width of blue..
width of green = height of gray .
same for the right image..
this is the only restriction.
Jan
Jan am 24 Feb. 2023
@MatlabUser: You can create the axes objects with a specific 'Position' property and use them as parents for the images. Therefore it is unclear, what exactly the problem is.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 24 Feb. 2023
Bearbeitet: Jan am 24 Feb. 2023
subplot calls axes with specific 'Position' proerpties inside. You can do this directly also.
ax1 = axes('NextPlot', 'add', 'Visible', 'off', ...
'Position', [0.1, 0.2, 0.05, 0.7]);
ax2 = axes('NextPlot', 'add', 'Visible', 'off', ...
'Position', [0.16, 0.15, 0.34, 0.05]);
ax3 = axes('NextPlot', 'add', 'Visible', 'off', ...
'Position', [0.16, 0.2, 0.34, 0.7]);
image(ax1, rand(10, 10, 3))
image(ax2, rand(10, 10, 3))
image(ax3, rand(10, 10, 3))
ax4 = axes('NextPlot', 'add', 'Visible', 'off', ...
'Position', [0.6, 0.2, 0.05, 0.7]);
ax5 = axes('NextPlot', 'add', 'Visible', 'off', ...
'Position', [0.66, 0.15, 0.34, 0.05]);
ax6 = axes('NextPlot', 'add', 'Visible', 'off', ...
'Position', [0.66, 0.2, 0.34, 0.7]);
image(ax4, rand(10, 10, 3))
image(ax5, rand(10, 10, 3))
image(ax6, rand(10, 10, 3))
  2 Kommentare
MatlabUser
MatlabUser am 24 Feb. 2023
thank you so much! it works
Jan
Jan am 24 Feb. 2023
You are welcome. I assume it is clear, how to apply the fine tuning to match your needs.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by