%% Basic Map Plotting
% uncomment and comment things at will. A comment is a percent sign.
load bathy.mat
close all
figure

% set up limits for latitude and longitude
% limits = [minimum maximum]
latlim = [32.55 32.8];
lonlim = [-117.55 -117];

% make a frame for a map
worldmap(latlim,lonlim)
framem('on')

% contour the bathymetry from bathy.mat. Just want contour lines without
% the background colors? Try the function "contourm". Play around with the
% line color on this command. What looks best? Play around with the contour
% levels. Right now they are set to make contours every 40 m of depth
% change. What happens when you make that step really big? Really small?
contourfm(bathyLat,bathyLon,bathyZ,'levelstep',40,'linecolor','none')
% color the map
demcmap(bathyZ)
%
hold on

% load in ship track location data
data = importdata('a_sp.gps');
t = data(:,1);
lon = data(:,2);
lat = data(:,3);

% plot ship track. Try changing the color and width of this line. For more
% info, type " doc plotm " in the command window.
plotm(lat,lon,'linewidth',2,'color','red')

% add a north arrow to the map
northarrow('latitude',32.75,'longitude',-117.5)

% add in a scale to the map, so we know how far away everything is. You can
% move these around and change the color once they are plotted by dragging
% them around on the map, or by right-clicking.
scaleruler on
setm(handlem('scaleruler1'),'color','white')
scaleruler('units','miles')
setm(handlem('scaleruler2'),'color','magenta')
% what other kinds of units can you put on there?


%%
% give your map a title
title('Title')

% give your map axis labels
ylabel('YLabel')
xlabel('XLabel')

% add a colorbar to show bathymetry values in meters
% h = colorbar;
% ylabel(h,'Elevation (meters)')

% add labels of where we did activities. You may do this with coding, or by
% hand in the figure window. If you do it in the figure window, however,
% you'll never be able to make the same exact figure again! So let's try 
% this with coding it in. 
% To add text,
% you'd use this line:
% textm(lat,lon,'text')
% to add shapes, you'd use this line:
% scatterm(lat,lon,50,'or','filled')
% this means you're plotting a filled red circle, 'or' at a certain lat,
% lon on the map. There are other shapes. Experiment!
% There is a list of site locations in this file folder, in "final
% detailed cruise plan.gdoc." You might also add the location of the blue
% whale siting (at the turn around point in deep water), and the second van
% veen grab on top of "the nines," or "nine mile bank", the shallower area
% just east of the steep drop off. You can see where we paused in the ship
% track to do the grab.