flip scatterm plot over world map

조회 수: 3 (최근 30일)
manuel FOSSA
manuel FOSSA 2016년 12월 1일
답변: manuel FOSSA 2016년 12월 2일
I want to overlay a scatterm plot over a world map.
The code is like:
ax = axesm('MapProjection','eqdcylin','MapLatLimit',latlim,'MapLonLimit',lonlim)
ax2 = axesm('MapProjection','eqdcylin','MapLatLimit',latlim,'MapLonLimit',lonlim)
load coastlines;
geoshow(ax,coastlat,coastlon ...);
scatterm(ax2,latcoord,loncoord...);
The problem is that the scatter plot is flipped so i need to flip it back.
But doing
set(ax2,'YDir','reverse');
Flips both the map and the scatter plot.
According to matlab documentation it is probably because only one axesm can be activated at a time.
How can i flip only the scatterm plot?

채택된 답변

manuel FOSSA
manuel FOSSA 2016년 12월 2일
The solution was simple:
ax = axesm('MapProjection','eqdcylin','MapLatLimit',latlim,'MapLonLimit',lonlim)
load coastlines;
geoshow(ax,coastlat,coastlon ...);
scatterm(ax,fliplr(latcoord),loncoord...);

추가 답변 (1개)

KSSV
KSSV 2016년 12월 1일
You define two axes like in the link and try to reverse.
Or reverse the data the way you want before plotting.
  댓글 수: 3
KSSV
KSSV 2016년 12월 1일
The question itself the user used two axis.
manuel FOSSA
manuel FOSSA 2016년 12월 1일
As the user noted, the final solution is not satisfying graphically.

댓글을 달려면 로그인하십시오.

카테고리

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