Is it possible to bring "grid on" to the front of a figure?

조회 수: 48 (최근 30일)
BN
BN 2020년 5월 6일
댓글: Fernando Galaz Prieto 2021년 9월 6일
Dear all,
Normally when I use the grid on it appears behind my figure, but I need to bring it on my figure. Is it possible? I searched and found a code to burn a grid into an image but here I have a figure.
Here is my figure:
And this the summarized code to generate it:
S = shaperead ('country_Boundary.shp');
lon = S.X;
lat = S.Y;
plot(lon, lat, '-k')
grid on
set(gca,'YTick',(24:.5:44))
set(gca,'XTick',(44:.5:64))
Thank you for any suggestions.

채택된 답변

Kelly Kearney
Kelly Kearney 2020년 5월 6일
By default, all plotted objects are rendered on top of the axis (including axis lines, grid lines, etc). You can reverse that by modifying the layer property:
set(gca, 'layer', 'top');
  댓글 수: 2
BN
BN 2020년 5월 6일
Thank you so much
Fernando Galaz Prieto
Fernando Galaz Prieto 2021년 9월 6일
Thank you for this answer. Is there a way to bring to the top a specific primitive object only?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by