Borrar filtros
Borrar filtros

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

29 visualizaciones (últimos 30 días)
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!

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Abr. de 2021
Use plotm() instead of plot() or viscircles()
  4 comentarios
Robyn Seery
Robyn Seery el 25 de Abr. de 2021
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 el 25 de Abr. de 2021
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Geographic Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by