How can overlay two contour plot in a subplot?
조회 수: 16 (최근 30일)
이전 댓글 표시
Lemuel Carlos Ramos Arzola
2020년 2월 7일
답변: Lemuel Carlos Ramos Arzola
2020년 2월 9일
Hello,
I am trying to plot and overlay two contour plots in the same figure but with some specifications. Both plots share the same x and y coordinates (and scales).
1. This two contour plot must be in a subplot of 2x1.
subplot(2,1,1)
2. The first contour plot (background) must be with lines and filled with his own colorbar.
Z1 = peaks;
contourf(Z1,'--')
colorbar
axis equal
3. The second contour plot (foreground) must overlay the first one and NOT be filled, just lines without colorbar.
Z2 = peaks.^2;
contour(Z2,'-')
axis equal
I am not using my real data for simplicity. How can we overlay this plots? Without destroying the first plot (preserve colors and colorbar). I reviewed these links but when I use the subplot function it does not work.
Thanks in advance for the answers.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!