Plot 3d points in a map
조회 수: 59 (최근 30일)
이전 댓글 표시
Hi,
I have geographical measurements from an aircraft with latitude, longitude and height coordinates. How can I display the measurements on a map as points three dimensionall where the color of the points change according to the measured value, e.g. temperature?
I have tried using geoplot3 which nicely displays the track of the aircraft. However, this function doesn't seem to allow for point plotting and changing the color according to the measured value. Geoscatter looks like an option but this only seems to work for 2D.
Any help is appreciated.
댓글 수: 0
답변 (1개)
Mathieu NOE
2024년 2월 8일
hello
not an user an neither an expert of geoplot and alike , but maybe this helps
x = [47 50 55 61]; % lat
y = [-122 -132 -140 -149]; % lon
z = [0 170 200 50]; % altitude
h = geoplot(x,y,'-*k');
h.ZData = z; % so now altitude also appears when you click on the point
% modify color of line (edge) according to altitude
N = 256; % color levels
caxis([0 N]);
cd = colormap(parula(N+1));
tmp = linspace(min(z),max(z),N+1); % interp z altitude
cd = interp1(tmp,cd,z); % map color to z values
cd = uint8(cd'*255); % need a 4xN uint8 array
cd(4,:) = 255; % last column is transparency
cbv=colorbar('v');
ind = (0:32:N);
set(cbv,'YTick',ind,'TickLabels',cellstr(num2str(tmp(ind+1)')))
drawnow
set(h.Edge,'ColorBinding','interpolated','ColorData',cd)
댓글 수: 2
Mathieu NOE
2024년 2월 8일
I don't have the Map Tbx, so I wont be able to try my idea on geoplot3, but you can probably do it on your side
참고 항목
카테고리
Help Center 및 File Exchange에서 Geographic Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

