How to draw the map bounding box over the grid using the Mapping Toolbox?
Afficher commentaires plus anciens
Greetings all,
I have been trying to make my map pretty by changing the line width of my grid.
And when I do that, the grid draws on the top of the map's bounding box.
latLim = [-53.7 -52];
lonLim = [-41 -39.2];
figure
h = worldmap(latLim, lonLim);
setm(gca, 'FontSize', 20);
setm(gca, 'GLineWidth', 2);
set(gca, 'LineWidth', 2);
And the result is:

Not very pretty or "professional". 😔
I tried:
set(gca ,'Layer', 'Top')
No success.
I tried setm and computer says no.
Would you have any idea how on earth can we tell Matlab to draw the bounding box over the grid?
Thank you in advance.
Réponses (1)
Prince Sachdeva
le 18 Juin 2020
I understand that you want to draw a bounding box over the grid, you can update the code as shown below:
latLim = [-53.7 -52];
lonLim = [-41 -39.2];
figure
h = worldmap(latLim, lonLim);
axis('on'); % this is the KEY line
setm(gca, 'FontSize', 20);
set(gca ,'Layer', 'Top');
set(gca, 'LineWidth', 5);
setm(gca, 'GLineWidth', 2);
2Â commentaires
Benoit Espinola
le 18 Juin 2020
Benoit Espinola
le 18 Juin 2020
Modifié(e) : Benoit Espinola
le 18 Juin 2020
Catégories
En savoir plus sur Create Plots on Maps dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


