Shifting the z-position of imagesc() when used along with surf

조회 수: 10 (최근 30일)
dileesh pv
dileesh pv 2020년 11월 28일
댓글: dileesh pv 2020년 11월 29일
I want to create a surf plot along with an image on the same object as given below;
figure(1)
surf(x,y,z);hold on
imagesc(x,y,z);
By default the z position of the imagesc is at z=0, which does not serve my purpose. I want to shift the location either upwards or downwards in z-direction. I understand that imagesc is a 2-D plot object and it does not have a z- axis. Is there any work around to shift the position of the imagesc along the z axis of the surf plot?
Thanks!

채택된 답변

Walter Roberson
Walter Roberson 2020년 11월 28일
편집: Walter Roberson 2020년 11월 29일
hgtransform group with a transformation matrix that is a z translation, and parent the imagesc to that.
However I would suggest rescale() and then warp() https://www.mathworks.com/help/images/ref/warp.html#d122e242257
  댓글 수: 3
Walter Roberson
Walter Roberson 2020년 11월 29일
I recommend the warp() version: it creates a surface() object, and that object will not disappear if you view it at an angle (as happens for image objects.)
dileesh pv
dileesh pv 2020년 11월 29일
Sure.. I shall try that too!!! Thanks!

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

추가 답변 (1개)

dileesh pv
dileesh pv 2020년 11월 29일
The solution has been shared in the fileexchange incase someone is interested.

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by