Error: "Adding Cartesian plot to geoaxes is not supported."

29 次查看(过去 30 天)
Hi,
I am trying to plot a simple circle over geoscatter map data, however when I try to overlay anything with the geoscatter plot, the following error shows:
"Adding Cartesian plot to geoaxes is not supported."
The code below shows two locations. I would like to overlay a circle of radius d and centre at lat(1), lon(1), but I can't seem to figure out how to achieve this. Is this possible using geoscatter?
lat = [53.372056 53.3771]; % latitudes
lon = [-6.614672 -6.58749]; % longitudes
d = 1.8884e3; % distance between two locations
geoscatter(lat, lon); % plots two locations on map
I am open to any other methods of implementing this if it is not possible using geoscatter. The main requirement here is that the geographic street map data is visible.
Thanks in advance!

采纳的回答

Walter Roberson
Walter Roberson 2021-4-25
Use plotm() instead of plot() or viscircles()
  4 个评论
Robyn Seery
Robyn Seery 2021-4-25
Yes, I have tried geobubble and geoshow, and geoplot, but still no luck!
Very nice visualisation functions, however none of them seem to be compatible for overlaying anything other than other geo-data plots.
Walter Roberson
Walter Roberson 2021-4-25
Perhaps
lat = [53.372056 53.3771]; % latitudes
lon = [-6.614672 -6.58749]; % longitudes
d = 1.8884e3; % distance between two locations
geoscatter(lat, lon); % plots two locations on map
hold on
geoplot(lat(1), lon(1), 'o', 'markersize', 30)
markersize is in points, rather than in geographic units.
You can also construct circles in the usual ways,
r = 20;
[x,y] = pol2cart(linspace(0,2*pi,30), r);
geoplot(lat(2)+x, lon(2)+y, 'k-')
Looks like the units is degrees! Well, this does happen to give a good illustration of the problem I mentioned before, that geoplot is in geographic coordinates, so you have to define whether you want a geographic circle or a visual circle.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geographic Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by