how to create one plot with several contours (corner plot)
Mostrar comentarios más antiguos
I have contours created by several matrices.
I need to arrange them in that manner:

How can I do so? (of course I already have the matrices and each contour seperatley )
2 comentarios
KSSV
el 8 de Abr. de 2022
REad about subplot, tiledlayout.
Tal Shavit
el 8 de Abr. de 2022
Respuestas (1)
tcl = tiledlayout(3,3,'TileSpacing','none');
tileIdx = [1,4,5,7,8,9]; % row-wise index of tiles
ax = gobjects(size(tileIdx));
for i = 1:numel(tileIdx)
ax(i) = nexttile(tcl,tileIdx(i));
contour(ax(i), magic(8))
end
% equate axis ranges and turn off tick labels for inner axes
linkaxes(ax)
set(ax(3),'YTickLabel',[],'XTickLabel',[])
set(ax(5:6),'YTickLabel',[])
7 comentarios
Tal Shavit
el 8 de Abr. de 2022
Adam Danz
el 8 de Abr. de 2022
You'll plot the contours within the for-loop (copied below)
I just used filler data in my demo.
for i = 1:numel(tileIdx)
ax(i) = nexttile(tcl,tileIdx(i));
contour(ax(i), magic(8)) % <----- here
end
Tal Shavit
el 8 de Abr. de 2022
Adam Danz
el 8 de Abr. de 2022
Tal Shavit
el 8 de Abr. de 2022
Adam Danz
el 8 de Abr. de 2022
It looks like you didn't include the lines at the bottom of my answer using linkaxes and the two set commands.
linkaxes will link all of the axes limits and tick. The two set commands will eliminate the axis tick labels in the inner tiles.
Tal Shavit
el 9 de Abr. de 2022
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


