Move Longitude axis above scatterplot
Mostrar comentarios más antiguos
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 comentarios
Joseph Cheng
el 2 de Jun. de 2021
would like to test but an ugly way would to follow:
what was set here...
dpb
el 2 de Jun. de 2021
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
el 3 de Jun. de 2021
Editada: Debbie Green
el 3 de Jun. de 2021
dpb
el 3 de Jun. de 2021
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).
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interact with Maps en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
