Hi David ,
You can use “gname” function to label plots created by “plot” ,“scatter” ,”gscatter” ,”plotmatrix” and “gplotmatrix”. But not for plots created by “geoplot”.
This is due to the differences in the underlying data types, coordinate systems, and plot handling between standard MATLAB plots and geographic plots.
A workaround for labeling points on geographic plots would be to use “gtext” function with latitude and longitude coordinates.
geoplot([40:5:50],[-104:-10:-125],'o', 'MarkerFaceColor','b');
gtext({'1st';'2nd';'3rd'})
plot([-104:-10:-125],[40:5:50],'o', 'MarkerFaceColor','b');
xlabel('Latitude'); ylabel('Longitude')
gname({'1st','2nd','3rd'})
You might find these resources helpful:
- https://www.mathworks.com/help/stats/gname.html
- https://www.mathworks.com/help/matlab/ref/gtext.html
Hope this helps!