Add 0.5 *0.5 degree grid on figure (country)
1 view (last 30 days)
Show older comments
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:
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
0 Comments
Accepted Answer
Star Strider
on 16 Jan 2020
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.
0 Comments
More Answers (1)
Spencer Chen
on 16 Jan 2020
You can set the XTick and YTick properties of the axis.
Blessings,
Spencer
0 Comments
See Also
Categories
Find more on Annotations 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!