필터 지우기
필터 지우기

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

조회 수: 29 (최근 30일)
Robyn Seery
Robyn Seery 2021년 4월 25일
댓글: Walter Roberson 2021년 4월 25일
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