Topography in a pcolor graph

25 Ansichten (letzte 30 Tage)
Lydia Abigail Garza Coello
Lydia Abigail Garza Coello am 27 Okt. 2020
Kommentiert: Adam Danz am 18 Jul. 2022
Hi,
I created a pcolor graph with the magnitude of the velocity of the wind in a specific location. I want to know how to add the topography of the place, I tried two options: with geobasemap('topographic') and with contour(z) where z= height (msl) matrix, but it didn't work.
If I use geobasemap separated from pcolor, I can see the specific area with the topography but without the magnitude of velocity. Should I switch to use geobasemap('topographic') and try to display the magnitude of the wind in that graphic? How is it possible?
The magnitude of the velocity and the coordinates (latitude and longitude) are 3 matrixes that have the same dimensions.
Thanks in advance.
Abby

Akzeptierte Antwort

Adam Danz
Adam Danz am 28 Okt. 2020
Bearbeitet: Adam Danz am 28 Okt. 2020
The types of graphics objects that can be plotted to geographic axes are limited. For wind velocity, quiver arrows would be nice but neither quiver nor quiverm are accepted by geographic axes.
These options could visualize magnitudes at specific geo coordinates but they wouldn't specify the direction of a vector (ie, wind direction).
You're probably better off using map axes which allow for greater flexibility and support a wider range of graphics objects including quiver.
% Produce base map
load korea5c
worldmap(korea5c,korea5cR)
geoshow(korea5c,korea5cR,'DisplayType','texturemap')
demcmap(korea5c)
% Show the *real* axes
% axis on
% Get axis limits
lonLim = xlim();
latLim = ylim();
% Produce (fake) wind data
[lon,lat] = meshgrid(linspace(lonLim(1),lonLim(2),10), linspace(latLim(1),latLim(2),10));
U = sin(lat);
V = cos(lon);
% Plot wind velocity
hold on
quiver(lon,lat,U,V,'k','LineWidth',2)
  8 Kommentare
Adam Danz
Adam Danz am 18 Jul. 2022
@Shai Katz answer moved here
============================
@Adam Danz Thank you for your response.
Where can I see all the files that can be loaded? here is just an axample of korea5c file..
In addtion, What this line does:
[lon,lat] = meshgrid(linspace(lonLim(1),lonLim(2),10), linspace(latLim(1),latLim(2),10));
If I have my own lat and lon (and wind speed) so how should I adjust it to the script above?
I will add that all 3 are vectors.
Thanks again,
Shai
Adam Danz
Adam Danz am 18 Jul. 2022
@Shai Katz, let's reserve the answers section for answers/solutions and use comment sections for discussion.
Those files come with MATALAB's Mapping Toolbox and appear in the documentation page below.
To see the location of those files,
which korea5c.mat
/MATLAB/examples/map/data/korea5c.mat

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Geographic Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by