필터 지우기
필터 지우기

Plotting a single data line over a 2D image

조회 수: 5 (최근 30일)
Paul C
Paul C 2017년 6월 5일
댓글: Paul C 2017년 8월 22일
Hi, I have a base 2D image that represents some data on a map. I would like to pick a line along this image, and plot the corresponding quantities ABOVE the base image (so it would appear like in a 3D visualization). I feel like this is different from using plot3 and adding a base image at its bottom with imagesc. Also different from taking a slice from a 3D volume. Is there a strategy for this?

답변 (1개)

Yu-Tung Lin
Yu-Tung Lin 2017년 7월 19일
I assume you have the base image and the line data prepared. To plot a line above the image, I suggest to do the following.
After you plot the base image, add line and specify the X,Y,Z data.
Here, I used the same data for the base map and the line above for example. See following code:
%%base image
[X,Y,Z] = peaks;
figure
contour(X,Y,Z,20)
%%add line above
line(X,Y,Z+15) %add height to Z
view(3) % change the position of the viewer
This code will give you
  댓글 수: 1
Paul C
Paul C 2017년 8월 22일
Hi, thanks for the suggestion. However I would like to take only 1 line, say data along X = 15. I can't just put X=15 into it.

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by