Not a map axes. How to plot quiver and geobasemap in one figure?
15 views (last 30 days)
Show older comments
Hi everyone! I want to plot current vectors along a line (coordinates given by lat and lon) and corresponding map in the background. Here's my code:
geoplot([44.392186 44.393524],[8.930812 8.931615],'w:')
geolimits([44.390 44.396],[8.928 8.934])
geobasemap satellite
x = table2array(FData(:,4)); % x - longitudes stored in the table 'FData', column 4
y = table2array(FData(:,3)); % y - latitudes stored in the table, column 3
u = table2array(FData(:,7)); % u - horizontal extend (delta longitude), column 7
v = table2array(FData(:,6)); % y - vertical extend (delta latitude), column 6
quiverm(x, y, u, v,'.');
And here's the error: Not a map axes.
(Error using gcm (line 25) Not a map axes.)
(Error in quiverm (line 88) mstruct = gcm;)
I am very new to MATLAB and simply getting lost in this. Wasted quite a lot of time on trying things, but didn't work out. I'd appreciate any practical advice to solve this! Thanks much!
PS. Matlab version R2020a
0 Comments
Accepted Answer
Kevin Holly
on 21 Jan 2022
geoplot([44.392186 44.393524],[8.930812 8.931615],'w:')
geolimits([44.390 44.396],[8.928 8.934])
geobasemap satellite
load('FData.mat')
x = table2array(FData(:,4)); % x - longitudes stored in the table 'FData', column 4
y = table2array(FData(:,3)); % y - latitudes stored in the table, column 3
u = table2array(FData(:,7)); % u - horizontal extend (delta longitude), column 7
v = table2array(FData(:,6)); % y - vertical extend (delta latitude), column 6
gca
The axes is a GeographicAxes and the quiverm command only works on map axes. I could not find an equivalent quiver command for geoaxes, so I decided to use geoplot instead.
hold on
geoplot(y,x)
quiver only works on cartesian axes.
figure
quiver(y, x, v, u,'.');% quiverm(x, y, u, v,'.');
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!