clear all; %load in data from .mat file .mat file is a binary file created by MATLAB %and can be loaded using the load command. It is created using the save %command load('week_5_data.mat'); %setup the colormap jet2 = jet(128); jet2(1,:) = [1 1 1]; %now create a figure using the mapping toolbox figure(1); axesm miller; hold on; %use contourm to contour the outline of the land masses contourm(lat, lon, ocean_mask(161:560,:), 'k-'); %use surfacem to plot the annual mean precipitation from TRMM surfacem(lat, lon, trmm_annual_mean); %set the surface to a really low altitude so the contour will be visible zdatam(handlem('surface'), -9999); %set the colormap colormap(jet2); %set the font size for the axes set(gca,'fontsize',8); %now use setm to set properties for the map axes %turn the grids on setm(gca, 'ParallelLabel', 'on'); setm(gca, 'MeridianLabel', 'on'); %set the grid color and style setm(gca, 'Grid', 'on', 'GColor', [0 0 0], 'GLineStyle', '--'); %set up meridian (longitude) line locations, label locations, label format %and font size setm(gca, 'MLineLocation', [-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180]); setm(gca, 'MLabelParallel', -57, 'MLabelLocation', [-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180], 'LabelFormat', 'signed','fontsize',8); %do the same thing for the map parallels (latitude) setm(gca, 'PLineLocation', [-50 -40 -30 -20 -10 0 10 20 30 40 50],'plabelmeridian',-184); setm(gca, 'PLabelLocation', [-40 -20 0 20 40]); %set up the colorbar cbar = colorbar('Location', 'eastoutside', 'YAxisLocation', 'right','position',[0.915 0.15 0.02 0.745]); caxis([-44 5500]); set(cbar,'YTick', [0 1000 2000 3000 4000 5000],'ylim',[1 5500]); %set figure size set(gcf, 'Units', 'inches','position',[2 2 6.3 2.0]); %set aspect ratio set(gca,'DataAspectRatio',[1.01 1 1]); set(gcf,'Paperpositionmode','manual','paperposition',[1 1 6.3 2.0]); %setup title title_string = sprintf('3B42 Mean Annual Accumulation (1998-2007)'); title(title_string,'fontsize',10); %print figure as a color eps with 300 dpi resolution print('-depsc', '-r300', 'world_annual_accum.eps');