フィルターのクリア

2D contour in 3D

6 ビュー (過去 30 日間)
John
John 2012 年 9 月 25 日
I have a visualization question. I am plotting a slice of data as a 2-dimensional contour using contourf(). What I would like to do is rotate this to show where it sits in 3D, and be able to use the 3D-rotation cursor. The problem is, contourf() really thinks this is just X and Y, and the cursor doesn't want to flip things on it's side. Is there a way to take the contour and plot it in a larger 3D context?

採用された回答

Walter Roberson
Walter Roberson 2012 年 9 月 25 日
contour() and contourf() work oddly. They call an internal routine that creates patches in 3D at the height of the contour planes, and then they run through and set the Z values to 0 deliberately.
An undocumented trick to this process is that for each patch, the Userdata field of the patch is set to a value which is the Z coordinate. This allows you to post-process, run through the patches, fetch their Userdata, and set the Z values back.
  2 件のコメント
John
John 2012 年 9 月 25 日
Thank you, that makes sense, and I think I found an example online. Can I similarly alter the X and Y locations?
Walter Roberson
Walter Roberson 2012 年 9 月 25 日
The XDATA and YDATA for contours are at the places determined by the contouring algorithm. You could alter them if you have reason to, but of course that will change the shape of the contour lines unless you are adding a constant to all of the pairs.

サインインしてコメントする。

その他の回答 (1 件)

Robert Cumming
Robert Cumming 2012 年 9 月 25 日
  1 件のコメント
John
John 2012 年 9 月 25 日
I guess what I am trying to do is to give it actual 3-D coordinates, not just rotate it. It rotates strangely when Y represents Z.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by