insert textbox in a geoshow plot

时间:2015-06-25 10:00:04

标签: matlab

I am using a code as below for a geoshow plot:

figure1 = figure;
load coast;
axes1 = axes('Parent',figure1,'FontSize',12,'DataAspectRatio',[1 1 1],'CLim',[0 4000]);
box(axes1,'on');
grid(axes1,'on'); 

geoshow(lat, long,'Color', 'black');
geoshow(latpr, longpr,'Color', 'blue'); 
geoshow(Lat_receiver,Lon_receiver,'DisplayType','point','Marker','.','MarkerSize', 30,'MarkerEdgeColor', 'green');

latpr, longpr is the set of data of a path that I want to show. Now I want to insert a text in the plot that is lat, long of the starting point (latpr(1,1), longpr(1,1)) and of the last point (latpr(end,1),longpr(end,1)).
How to insert the text?

1 个答案:

答案 0 :(得分:0)

There is the textm function which can be used to project text annotations on map axes. Something like this should work: textm(latpr(1,1), longpr(1,1),'Your string'); and likewise: textm(latpr(end,1), longpr(end,1),'Your string');