Move Longitude axis above scatterplot
이전 댓글 표시
Below is my matlab code that plots locations in a region of interest:
axis = geoaxes('basemap','satellite');
S = struct(axis);
hold on
lat = normrnd(29,0.2,[1,50]);
lon = normrnd(-90,0.2,[1,50]);
geoscatter(axis,lat,lon,30,'.')
The lat/lon data is dummy data for reproducibility purposes. I want to put the Longitude axis above the scatterplot because I will eventually put a colorbar right below the figure. When using the plot function, I understand the following line can put the X-axis on top of a plot:
set(gca,'XAxisLocation','top','YAxisLocation','left')
However, I can't find the same capabilitiy for the geoscatter function.
Any suggestions on how I can accomplish the my goal?
댓글 수: 4
Joseph Cheng
2021년 6월 2일
would like to test but an ugly way would to follow:
what was set here...
dpb
2021년 6월 2일
Doesn't appear to be a visible property according to https://www.mathworks.com/help/matlab/ref/matlab.graphics.axis.decorator.geographicruler-properties.html
It's either kludge to draw manually as I presume the above link does or see if there is a useful hidden property that will let you get at the axes location property. Yair's FEX submission <Get undocumented object properties> is invaluable for finding these to workaround the warts.
Sometimes, however, there just isn't anything accessible, unfortunately, despite what see like obvious needs for users to be able to control I don't have necessary toolbox to try...
Debbie Green
2021년 6월 3일
편집: Debbie Green
2021년 6월 3일
dpb
2021년 6월 3일
Was afraid of that...why Mathworks has developed such a penchant recently for these opaque/dark graphics objects that hide useful/needed properties on the basis apparently of "Mother knows best!" is maddening and wastes untold numbers of users' hours more productively spent doing the research/productive work rather than fighting the toolset.
I'd suggest to submit enhancement request for the feature (and any others you run into along the way).
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interact with Maps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
