MATLAB: Problem while working to plot the track of the cyclone.

axes ticklabelstrack;

Hi ! I have lat and lon values to plot the track of the cyclone. I am getting two graphs after i run the code.
If i uncomment the "figure;" from it, then i am unable to see the graph of axes tick labels. Please help me to fix the problem! Below is my script forwarded.
load coastlines
axesm('mercator','MapLatLimit',[11 20],'MapLonLimit',[80 98],...
'Grid','off','Frame','off','MeridianLabel','off','ParallelLabel','off')
geoshow(coastlat,coastlon,'DisplayType','line','color','b')
%These are the waypoints I has selected.
waypoints = [12.5,92.5; 12.6 91.8; 13,90.7; 13.4,89.6; 13.6,89.2; 13.7,88.7; 14,88.2; 14.2,87.8; 14.4,87.6; 14.8,87.1; 15.4,86.9; 15.9,86.5; 16,85.8; 16,85.2; 16.3,84.8; 16.6,84.6; 17.2,84.2; 17.5,83.5; 18,82.9];
%Now display the track.
figure;
[lttrk,lntrk] = track('rh',waypoints,'degrees');
geoshow(lttrk,lntrk,'DisplayType','line','color','r')
xlabel('Longitude');ylabel('Latitude');title('Hudhud Cyclone 2014');

Best Answer

Read about hold on. You need to use that, when you plot two graphs on one figure.
load coastlines
axesm('mercator','MapLatLimit',[11 20],'MapLonLimit',[80 98],...
'Grid','off','Frame','off','MeridianLabel','off','ParallelLabel','off')
geoshow(coastlat,coastlon,'DisplayType','line','color','b')
%These are the waypoints I has selected.
waypoints = [12.5,92.5; 12.6 91.8; 13,90.7; 13.4,89.6; 13.6,89.2; 13.7,88.7; 14,88.2; 14.2,87.8; 14.4,87.6; 14.8,87.1; 15.4,86.9; 15.9,86.5; 16,85.8; 16,85.2; 16.3,84.8; 16.6,84.6; 17.2,84.2; 17.5,83.5; 18,82.9];
%Now display the track.
% figure;
hold on
[lttrk,lntrk] = track('rh',waypoints,'degrees');
geoshow(lttrk,lntrk,'DisplayType','line','color','r')
xlabel('Longitude');ylabel('Latitude');title('Hudhud Cyclone 2014');