How to hide the grid lines using GRIDM function behind a marker in map axes?

1 vue (au cours des 30 derniers jours)
Prabhakar
Prabhakar le 18 Jan 2011
When I use GRIDM for a map containing a marker, the grid lines appear in front of the marker.
axesm('pcarree','MapLatLimit',[-90 90],'MapLonLimit',[-90 90]);
gridm
plotm(0,0,'o','MarkerSize',18,'MarkerFaceColor','g');
I want to hide the grid lines behind the marker.

Réponses (2)

Michael
Michael le 18 Jan 2011
The grid lines appear in front of the marker as the default ‘ZData’ property of grid lines is positive. Set the ‘ZData’ values of grid lines to be negative.
axesm('pcarree','MapLatLimit',[-90 90],'MapLonLimit',[-90 90]);
Hg = gridm;
plotm(0,0,'o','markersize',18,'markerfacecolor','g');
set(Hg(1),'ZData',0*get(Hg(1),'ZData')-1);
set(Hg(2),'ZData',0*get(Hg(2),'ZData')-1);
  1 commentaire
Walter Roberson
Walter Roberson le 20 Jan 2011
Possibly true in practice, but see below for the more official mechanism.

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 20 Jan 2011
GAltitude
scalar z-axis value {Inf}
Grid z-axis setting — Sets the z-axis location for the grid when displayed. Its default value is infinity, which is displayed above all other map objects. However, you can set this to some other value for stacking objects above the grid, if desired.
Thus in order to have the markers above the grid, the GAltitude must be set below the lowest altitude used in the map.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by