Plot multiple 2D contour plots in one 3D figure
37 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2019-8-21
回答: MathWorks Support Team
2019-8-28
I have multiple 2D contour plots that I'd like to plot in one 3D figure one on top of the other with some distance in between each of the plots. How to do this?
采纳的回答
MathWorks Support Team
2019-8-28
You can achieve this by modifying the 'ContourZLevel' property of the contour plots. For example, the following plots two contour plots with some distance between them in the Z-direction:
[X,Y,Z] = peaks;
hold on
[~,h] = contour(X,Y,Z,20); % plot contour at the bottom
h.ContourZLevel = -9;
[~,h] = contour(X,Y,Z,20); % plot contour at the top
h.ContourZLevel = +9;
hold off
view(3);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!