Extracting matrix and making 2D plot
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Chihiro Omori
am 19 Mär. 2019
Kommentiert: Chihiro Omori
am 2 Apr. 2019
I made 2-D color map by using those datasets below
- latmat.mat... latitude data (171*171)
- lonmat.mat...longitude data(171*171)
- CH4.mat.... CH4 emission data (171*171)
Coding is as follows,
figure
latlim=[min(latmat(:)) max(latmat(:))]
lonlim=[min(lonmat(:)) max(lonmat(:))]
ax=usamap(latlim,lonlim);
title('Air Pollution Map');
surfm(latmat,lonmat,CH4)
states=shaperead('usastatehi',...
'UseGeoCoords',true,'BoundingBox',[lonlim',latlim']);
geoshow(ax,states,'FaceColor','none')
contourcbar
And got this figure below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209288/image.jpeg)
However, I would like to make a map within those ranges below.
70W<Longitude<75W
40N<Latitude<43N
How can I extract the datasets and make a colormap?
0 Kommentare
Akzeptierte Antwort
Krishna Zanwar
am 22 Mär. 2019
You can change the limits by replacing
latlim=[min(latmat(:)) max(latmat(:))]
lonlim=[min(lonmat(:)) max(lonmat(:))]
by
lonlim=[-75 -70];
latlim=[40 43];
I have attached the output of the graph below.
Hope it helps.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!