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
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
Youssef Khmou 2013 年 6 月 1 日
編集済み: Youssef Khmou 2013 年 6 月 1 日

0 投票

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
Davey 2013 年 6 月 1 日
I don't really know how I would apply this to the problem stated above. I already have the 2D contour maps, I just need to get them into, and orientate them correctly spatially, in a 3D plot.....
Thanks for your answer though!
Youssef  Khmou
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
Davey 2013 年 6 月 2 日
hey,
The 3D is just a volume (where x and y equal the x and y for the 2D contour plots) and Z goes from 0 to 800.
My problem is that I can't get the 3D plot to represent the 2D contours. Making the contour maps themselves 3D is no problem but keeping them 2D and inserting them into the 3D volume like slices (as shown in the picture) i can't seem to do....
Thanks!
Youssef  Khmou
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
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
Kres Nielsen 2021 年 5 月 21 日
編集済み: Kres Nielsen 2021 年 5 月 21 日

0 投票

I believe contourslice is the solution here.

カテゴリ

質問済み:

2013 年 6 月 1 日

編集済み:

2021 年 5 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by