How can overlay two contour plot in a subplot?
16 views (last 30 days)
Show older comments
Lemuel Carlos Ramos Arzola
on 7 Feb 2020
Answered: Lemuel Carlos Ramos Arzola
on 9 Feb 2020
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 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!