How to hide the grid lines behind a marker in map axes using GRIDM function in Mapping Toolbox 3.2 (R2010b)?
3 views (last 30 days)
Show older comments
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.
Accepted Answer
MathWorks Support Team
on 14 Feb 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');
% Get the size of 'Zdata'
Z1n=size(get(Hg(1),'ZData'));
Z2n=size(get(Hg(2),'ZData'));
% set the ‘ZData’ values to -1
set(Hg(1),'ZData',-ones(Z1n));
set(Hg(2),'ZData',-ones(Z2n));
0 Comments
More Answers (0)
See Also
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!