Plot data on a global map

조회 수: 26 (최근 30일)
Thishan Dharshana
Thishan Dharshana 2023년 2월 12일
답변: Walter Roberson 2023년 2월 13일
Hello,
I have 3D matrix of size (360,180,300). I need to plot this on a global map. 360 represents longitudes, 180 represents latitudes and 300 represents temperature at each coordinate. I can use the following to draw the map boundaries.
worldmap('world')
load coastlines
plotm(coastlat,coastlon)
Please help me with this plotting.

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 12일
(1) Load your data
(2) Plot world map
(3) Hold on the plot figure
(4) plot your data on top of the world map. E.g.:
worldmap('world')
load coastlines
% World map plotted
plotm(coastlat,coastlon)
% Plot is held
hold on
% Load your data:
% E.g.:
X = coastlat(1:1800);
Y = coastlon(1:1800);
% Your data plotted on the top of the world map:
plotm(X, Y, 'r--', 'LineWidth',2)

Walter Roberson
Walter Roberson 2023년 2월 13일
As discussed in https://www.mathworks.com/matlabcentral/answers/1910990-global-map-based-on-data-from-a-3d-matrix#answer_1169590 you have the problem that you have multiple datapoints (12 in that discussion, 300 here) for each latitude and longitude combination.
The suggestions I gave there:
  • draw one plot for each layer of data; or
  • contour each layer of data with hold on and a different color of line. This might be difficult to understand
Otherwise, you need to start considering doing some kind of volume visualization, which might be a bit tricky to overlay on a map. You could try something like volshow or https://www.mathworks.com/help/images/ref/volumeviewer-app.html but those will not overlay on a map. And volume visualization is... difficult... to understand unless you are looking at something like isosurfaces of equal rainfail.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by