Home > utilities > do_surface_plot.m

do_surface_plot

PURPOSE ^

reads image and plots tracks or stations

SYNOPSIS ^

function [Plots]=do_surface_plot(plotOPTS,FVCOM)

DESCRIPTION ^

 reads image and plots tracks or stations

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Plots]=do_surface_plot(plotOPTS,FVCOM)
0002 % reads image and plots tracks or stations
0003 m_mappath;
0004 
0005 figure(plotOPTS.figure); clf
0006 m_proj('UTM','lon',[plotOPTS.range_lon],'lat',[plotOPTS.range_lat],'zon',plotOPTS.zone,'ell','grs80')
0007 m_grid('box','fancy')
0008 %m_usercoast(plotOPTS.coastline_file,'Color','k','LineWidth',3);
0009 %[X,Y]=m_ll2xy(plotOPTS.mesh.lon,plotOPTS.mesh.lat,'clip','on');
0010 X=plotOPTS.mesh.x;
0011 Y=plotOPTS.mesh.y;
0012 for aa=1:length(plotOPTS.Time_record)
0013     % plot map with plotOPTS.var_plot
0014     hold on
0015     try
0016         % 3D data (i.e. DYE, pH etc.)
0017         Plots(1).handles=patch('Vertices',[X,Y],'Faces',plotOPTS.mesh.tri,...
0018             'Cdata',squeeze(FVCOM.(plotOPTS.var_plot)(:,plotOPTS.nz_plot,aa)),...
0019             'edgecolor','interp','facecolor','interp');
0020     catch
0021         % 2D data only (i.e. zeta etc.)
0022         Plots(1).handles=patch('Vertices',[X,Y],'Faces',plotOPTS.mesh.tri,...
0023             'Cdata',squeeze(FVCOM.(plotOPTS.var_plot)(:,aa)),...
0024             'edgecolor','interp','facecolor','interp');
0025     end
0026     fprintf('Time step %i of %i\n',aa,length(plotOPTS.Time_record))
0027     caxis(plotOPTS.clims)
0028     colorbar
0029     set(get(colorbar,'YLabel'),'String',plotOPTS.var_plot)
0030     % check if mesh elements are required
0031     if plotOPTS.do_mesh
0032         % plot vertices
0033         [X,Y]=m_ll2xy(plotOPTS.mesh.lon,plotOPTS.mesh.lat,'clip','on');
0034         patch('Vertices',[X,Y],'Faces',plotOPTS.mesh.tri,...
0035             'EdgeColor',[0.6 0.6 0.6],'FaceColor','none'); hold on
0036     end
0037     %----------------------------------------------------------------------
0038     % Only in my case it needs adding 6 because proj automatically
0039     % determines a reference long in strides of 6deg while m_map doesn't
0040     %----------------------------------------------------------------------
0041     pause(plotOPTS.pause)
0042     if aa~=length(plotOPTS.Time_record)
0043         delete(Plots(1).handles)
0044     end
0045 end
0046 
0047 return
0048

Generated on Tue 18-Dec-2012 12:37:31 by m2html © 2005