Add 0.5 *0.5 degree grid on figure (country)

조회 수: 1 (최근 30일)
BN
BN 2020년 1월 16일
답변: Star Strider 2020년 1월 16일
Hey all, I was even read grid function documentation here: https://www.mathworks.com/help/matlab/ref/grid.html
But I don't know how to set 0.5 degrees * 0.5-degree grids on the country ?!
this code below although gives me grided figure but not in 0.5*0.5 degree
borders('Iran Islamic Republic of')
grid on
ax.GridLineStyle = '-';
the output is:
Capture.JPG
you can see it is not in 0.5*0.5 degree format and it's look like it is in 5 * 2 degree!
Thank you all

채택된 답변

Star Strider
Star Strider 2020년 1월 16일
This illustrates the general approach:
x = linspace(44, 64);
y = linspace(25, 40);
t = linspace(0,2*pi);
circx = 0.25*(max(x)-min(x))*cos(t)+min(x);
circy = 0.25*(max(y)-min(y))*sin(t)+min(y);
figure
plot(circx, circy)
xt = get(gca, 'XTick');
set(gca, 'XTick',round(linspace(min(xt),max(xt),2*numel(xt)-1),1), 'XTickLabel',round(linspace(min(xt),max(xt),2*numel(xt)-1),1))
yt = get(gca, 'YTick');
set(gca, 'YTick',round(linspace(min(yt),max(yt),2*numel(yt)-1),1), 'YTickLabel',round(linspace(min(yt),max(yt),2*numel(yt)-1),1))
I do not have the map coordinates, so I cannot reproduce the plot.

추가 답변 (1개)

Spencer Chen
Spencer Chen 2020년 1월 16일
You can set the XTick and YTick properties of the axis.
Blessings,
Spencer

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by