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!
0 个评论
采纳的回答
Walter Roberson
2021-4-25
Use plotm() instead of plot() or viscircles()
4 个评论
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 Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!