Plotting in contoursclice/slice

조회 수: 2 (최근 30일)
Shaik Ghouse Basha
Shaik Ghouse Basha 2023년 3월 7일
답변: Shaik Ghouse Basha 2023년 3월 7일
Hi, I am having
longitude=-180:5:180;latitude=-90:5:90;Data= matrix[73x37]. Like this I am having 12 matrixs.
I want to plot each matrix on global map (https://www.asu.cas.cz/~bezdek/vyzkum/rotating_3d_globe/figures/elevation_2d_map_Geoid_height_EGM2008_nmax500_BlueWhiteOrangeRed_px0650_pacific.png)
with 4 maps in single image (similar to contourslice/sclie function).
Please assist me how to plot the data.
Thanking you

답변 (3개)

Arka
Arka 2023년 3월 7일
Hi,
You can use the geoshow function to plot the data on the global map.
This is the process of doing it:
  1. Merge the data matrices into one cell array in MATLAB
  2. Load the map PNG into MATLAB using imread function
map = imread('path/to/map.png');
3. Create a new figure and set its size to the dimensions of the map like so:
figure('Units', 'pixels', 'Position', [0 0 size(map,2)*2 size(map,1)*2]);
4. Loop over the cell array of data matrices, and use geoshow to plot the data on the map. You can also use subplot or tiledlayout to have multiple maps in a single image.
for i=1:12
subplot(x,y,j); %replace x and y with the desired layout, and j with the map number you are referring to
geoshow(latitude, longitude, data{i}, 'DisplayType', 'texturemap');
hold on;
imshow(map);
end
geoshow displays the data as a texture on top of the map, and imshow displays the map in the background.
To learn more about geoshow and imshow, you can refer to the MathWorks documentations linked below:

Shaik Ghouse Basha
Shaik Ghouse Basha 2023년 3월 7일
Thank you for your reply.
This function didn't work for me.
M1=imread('Map01.png');
figure('Units', 'pixels', 'Position', [0 0 size(M1,2)*2 size(M1,1)*2]);
for i=1:4
subplot(4,1,i); %replace x and y with the desired layout, and j with the map number you are referring to
geoshow(pr(:,1), lo, Ez2{i}, 'DisplayType', 'texturemap');
hold on;
imshow(M1);
end
I need plot similar to the which I have attached.
  댓글 수: 1
Arka
Arka 2023년 3월 7일
Is it possible for you to share the matrices and arrays that you are using? It will be easier for me to test the code on my end and help you out better.

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


Shaik Ghouse Basha
Shaik Ghouse Basha 2023년 3월 7일
I have uploded the data sets. Please check

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by