Clear Filters
Clear Filters

help for scaleruler, northarrow

6 views (last 30 days)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA on 2 Jul 2023
Answered: Arun on 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 Comment
ProblemSolver
ProblemSolver on 13 Jul 2023
@ELISABETTA BILLOTTA -- Could you show your work, and provide a sample image on which you want these variables.

Sign in to comment.

Answers (1)

Arun
Arun on 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:
% Load a map
latlim = [0 40];
lonlim = [30 55];
load coastlines;
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);
% 2.Add Direction arrow
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.

Community Treasure Hunt

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

Start Hunting!