3D Surface Plot With Only Vectors

조회 수: 22 (최근 30일)
Dan
Dan 2011년 8월 18일
댓글: Image Analyst 2021년 9월 4일
I'm trying to make surface plots based on data from a satellite. All of the standard surface functions ('surface', 'contour', 'pcolor', etc.) require one of the fields to be a matrix, but the data I'm trying to plot is all in vectors. For instance, I have vectors for latitude and longitude of each reading, then a vector of the elevation read at each point. And the vectors are of considerable length, so I'm trying to use as little memory as possible for each plot.
'plot3(Lon, Lat, Elev)' almost gives me what I need, except I still can't put a detailed colormap to the elevation data. Ideally, I want to be able to look at the x-y plane and easily see the changes in elevation with the help of the colorbar.
Any ideas on a better function to use? Or is there a way to somehow get my elevation data into a matrix that doesn't give me a large, sparse matrix?
Thanks
  댓글 수: 1
Youssef Wehbe
Youssef Wehbe 2020년 4월 1일
I have an aircraft dataset and would like to plot a 3D flight track (lat,lon,elev) and color the markers according to a depth (dust concentration in my case). Any help is greatly appreciated!

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

답변 (4개)

Babak Salarieh
Babak Salarieh 2019년 1월 2일
편집: Image Analyst 2021년 9월 4일
I would suggest watching this video:
Although it is in regard to 3D surface, it works for the case of contours as well.
  댓글 수: 4
Majid
Majid 2021년 9월 4일
It is somehow strange! The link to the video is clickable, but when you click on it, you will be directed to the same page as the current page! However, you still can copy and paste the link manually to watch the video.
Image Analyst
Image Analyst 2021년 9월 4일
@Majid when @Babak Salarieh inserted the link, he had #null for the URL and the URL for this thread as the displayed text, so it just went to this page. I changed the URL to that of the blog, so it's now fixed. Thanks for alerting us.

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


Fangjun Jiang
Fangjun Jiang 2011년 8월 18일
This should work. Adjust the CircleSize for better result. See scatter3() for more options.
CircleSize=100;
figure;h1=stem3(Lon,Lat,Elev,'filled');
figure;h2=scatter3(Lon,Lat,Elev,CircleSize,Elev,'s','filled');
view(2);

Patrick Kalita
Patrick Kalita 2011년 9월 8일
Have you looked at trisurf?
The idea is that you first need to compute a triangulation of the (lat, lon) coordinates. The function delaunay will work fine. Then you can pass that along with the coordinate vectors to trisurf. Here's an example:
% make up some data
lat = rand(1,300)*6 - 3;
lon = rand(1,300)*4 - 2;
elev = peaks(lat, lon);
% triangulate and plot
tri = delaunay(lat, lon);
trisurf(tri, lat, lon, elev);
% optional, could help make the plot look nicer
shading interp
  댓글 수: 1
Edwin Fonkwe
Edwin Fonkwe 2017년 1월 17일
Doesn't work if vectors are collinear, apparently

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


Sanoop Siby
Sanoop Siby 2020년 3월 10일
If anyone knows the answer please post, I would appreciate it.
  댓글 수: 1
Youssef Wehbe
Youssef Wehbe 2020년 4월 1일
I have an aircraft dataset and would like to plot a 3D flight track (lat,lon,elev) and color the markers according to a depth (dust concentration in my case). Any help is greatly appreciated!

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

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by