How can I plot multiple 2D contour plots on a single 3D plot?
显示 更早的评论
I have a number of 2D contour plots, and I need to represent them on one single 3D plot at various Z axis intervals. Also, the X and Y boundaries of each contour plot are different in some cases.
This is the best example I could find:
Unfortunately there isn't anything like it in the plot gallery.
How do I do this?
Thanks!
Edit: Included the example in the original question.
1 个评论
Image Analyst
2013-6-1
编辑:Image Analyst
2013-6-1
Can you give a link with an example of what visualization you're trying to achieve? Maybe something in Plot Gallery: http://www.mathworks.com/discovery/gallery.html
回答(2 个)
Youssef Khmou
2013-6-1
编辑:Youssef Khmou
2013-6-1
You can use surf function as this example :
[x,y]=meshgrid(-1:0.1:1);
z=cos(x)+sin(y);
figure,surfc(x,y,z);
5 个评论
Davey
2013-6-1
Youssef Khmou
2013-6-2
hi the 3D is an M*3 or a 2d matrix?
did you try 'hold on ' after plotting the 3d and add the contour ?
Davey
2013-6-2
Youssef Khmou
2013-6-2
ok you can try to use the surf command :
[x,y]=meshgrid(-1:0.1:1);
contour=rand(size(x));
z=exp(-x.^2-y.^2);
surf(x,y,z,contour);
The contour now is placed according to the 3D object .
Athiya Sulthana
2015-9-25
As you mentioned....Making the contour maps themselves 3D is no problem.....how did you get that... it would be great if you can share it.
Kres Nielsen
2021-5-21
编辑:Kres Nielsen
2021-5-21
0 个投票
I believe contourslice is the solution here.
类别
在 帮助中心 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!