How to plot text in mapshow map
16 views (last 30 days)
Show older comments
David Franco on 13 Sep 2019
Commented: Priyank Pathak on 15 Sep 2022
I have this map I made using mapshow function:
I used the data in this structure to create the map:
My function is (I need to plot each citie with specific color):
load mapnew.mat % the structure with data
load resultscorrigido.mat % just for colors of cities
[C,ia,ic] = unique(results(:,1));
palett = flipud(hsv(numel(C))); % parula, jet, hsv
for ii = 1:numel(Snew)
color = palett(ic(ii),:);
I want to plot the names of the cities (Snew(:).NAME) using each LAT x LON coordinates. I tried the function textm, but I get an error:
Error using gcm (line 25)
Not a map axes.
Error in textm (line 96)
mstruct = gcm;
How can I put a code inside my for loop to plot each citie name in my map?
Thanks in advance!
Priyank Pathak on 15 Sep 2022
Find more on Mapping Toolbox 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!