Add contour to 3d surface plot

I have a 3d surface plot created using surf(x,y,z,c) and I would like to highlight a certain area by either drawing a contour line where each x,y,z triple exceeds a level, or by using a differnet colour in this an (or both)!
The help on contourslice is a bit obscure for me
Thanks

답변 (1개)

Wayne King
Wayne King 2011년 10월 6일

0 개 추천

Do you want a contour, or a patch()?
[X,Y,Z] = peaks;
surf(X,Y,Z); hold on;
patch(X,Y,4*ones(size(Z)),'green');
view(-20,4);

댓글 수: 4

Wayne King
Wayne King 2011년 10월 6일
sorry pasted incorrectly at first.
Julie
Julie 2011년 10월 7일
That didn't seem to work at all...
I have being playing wiith subvolume :
[a,b,c,V]=subvolume(X,Y,Z,V,[mx-3,mx,my-3,my,mz-3,mz])
but I get the error 'V must be a 3D array' - which isn't very helpful since I think v is a 3d array, (X, Y,Z = are all 30x30 matrces)
Any thoughts?
Sean de Wolski
Sean de Wolski 2011년 10월 7일
30x30 is 2d...
30x30x30 would be 3d.
Sean de Wolski
Sean de Wolski 2011년 10월 7일
You visualize a dimension for each component. x/y can be 1d vectors and you visualize them on a 2d x/y plot. x/y/z are 2d matrices and so you visualize them on a 3d plot.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

질문:

2011년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by