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!
