# help for scaleruler, northarrow

10 vues (au cours des 30 derniers jours)
ELISABETTA BILLOTTA le 2 Juil 2023
Réponse apportée : Arun le 10 Nov 2023
within a map with these coordinates
longrd=0:0.1:40;
latgrd=30:0.1:55;
I have to make this changes:
1) introduce the kilometric scale in the image
2) introduce north into the image
3) remove the values on the axes
4) insert the title inside the image and not above it.
I keep getting a bunch of errors like this:
Error using assert
Not an axesm-based map.
Error in gcm (line 26)
assert(isstruct(mstruct), ...
Error in northarrow (line 41)
gcm(hndl);
Anyone can help me?
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
ProblemSolver le 13 Juil 2023
@ELISABETTA BILLOTTA -- Could you show your work, and provide a sample image on which you want these variables.

Connectez-vous pour commenter.

### Réponses (1)

Arun le 10 Nov 2023
Hey Elisabetta,
I understand that you are facing difficulty in producing a map for some given latitude/longitude range values with kilometric scale, north introduction, title inside the map and without axes values.
Here is a sample code and some references which might be of help:
latlim = [0 40];
lonlim = [30 55];
axesm('MapProjection','mercator', 'MapLatLimit',latlim,'MapLonLimit',lonlim)
%use this if you want values on the
%worldmap(latlim,lonlim)
% Plot the map ( in accordance with the point number 3)
geoshow(coastlat, coastlon, 'Color', 'blue') % plot the map
% 1. Introduce the Kilometric scale
gs1 = scaleruler;
setm(gs1,"MajorTick",0:500:1000);
northarrow('latitude', 38, 'longitude', 32);
% 4.Add Title On the Map
textm(40, 37, ' Image Title', 'VerticalAlignment', 'top'); %latitude, longitute values
MATLAB help resources:
I hope this helps.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Map Customization dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by