How to display a plot in two figures

조회 수: 1 (최근 30일)
Ludovico Soldati
Ludovico Soldati 2019년 1월 28일
댓글: Dennis 2019년 5월 7일
Hi,
I have a graph done using contourf and I want to realize another figure in the same subplot, identical to the first one, where to add some more details. Now, the script is already pretty stuffed so I don't want to re-run the contourf function, also because I have to do it more than one time, so my question is if it is possible to use the "informations" that contourf found in order to display them in two separate figures.
Thank you all!
  댓글 수: 3
Ludovico Soldati
Ludovico Soldati 2019년 5월 7일
Hi, unluckily I don't. I used contourf again and uncommented this one only when I needed to. Actually it is strange that there isn't the possibility to do something easy like this
Dennis
Dennis 2019년 5월 7일
I am not sure if i understand the question correctly. Do you want multiple figures in 1 subplot or 1 plot in multiple figures?
If you just want to display the contourf result in 2 subplots/figures you can copy them (might need to fix xlim/ylim).
A=peaks;
subplot(3,1,1);
[~,a]=contourf(A);
b=subplot(3,1,2);
copyobj(a,b)
xlim([1 49])
ylim([1 49])

댓글을 달려면 로그인하십시오.

답변 (1개)

Sarah Crimi
Sarah Crimi 2019년 1월 28일
편집: Sarah Crimi 2019년 1월 28일
Hi, have you looked at the contour slice command?
https://www.mathworks.com/help/matlab/ref/contourslice.html
  댓글 수: 1
Ludovico Soldati
Ludovico Soldati 2019년 1월 28일
Hi,
Sorry I wrote wrong the function I used: it is contourf and not contour.
Anyway, yes I know that function, but does it allow you to plot two identical graphs in two separate figures without having to rerun it?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by