/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_misc/depthStretchPlot.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/gcmfaces_misc/depthStretchPlot.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Jun 23 19:02:47 2011 UTC (14 years ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65r, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
gcmfaces_misc	added headers to all routines
				added depthStretch.m and depthStretchPlot.m
				> removed myverticaldeform.m, verticalplot.m
				and runmean_cycle.m
				rewritten runmean.m
				> removed nanrunmean.m, nanrunmean_cycle.m and runmean_cycle.m
gcmfaces_legacy	added nanrunmean.m, nanrunmean_cycle.m, runmean_cycle.m
				myverticaldeform.m, verticalplot.m
plot_one_field	added example of depthStretchPlot
basic_diags_display_transport	added header

1 gforget 1.1 function [varargout]=depthStretchPlot(plotName,plotData,varargin);
2     %object: front end to plot/pcolor/etc. using a stretched depth coordinate (see depthStretch.m)
3     %inputs: plotName is the name of the plotting routine (e.g. 'pcolor')
4     % plotData is the list or arguments to pass over to the plotting routine
5     % in a cell array (e.g. {depth,time,temperature}), with the
6     % depth coordinate coming second (as usual for plot/pcolor/etc.)
7     %optional: depthTics is the vector of yTics depths
8     % depthStretchLim are the stretching depth limits ([0 500 6000] by default)
9     % to pass over to depthStretch (type 'help depthStretch' for details).
10     %
11     %notes: the depth coordinate must be first in plotData
12    
13     %get depthStretchDef if provided
14     if nargin>2; depthTics=varargin{1}; else; depthTics=[0:100:500 750 1000:500:6000]; end;
15     if nargin>3; depthStretchDef=varargin{2}; else; depthStretchDef=[0 500 6000]; end;
16    
17     %replace it with stretched coordinate:
18     plotData{2}=depthStretch(abs(plotData{2}),depthStretchDef);
19    
20     %do the very plot:
21     eval(['h=' plotName '(plotData{:});']);
22    
23     %take care of depth tics in stretched coordinate:
24     depthTics=sort(depthTics,'descend');
25    
26     depthTicsLabel=[];
27     for kkk=1:length(depthTics)
28     depthTicsLabel=strvcat(depthTicsLabel,num2str(depthTics(kkk)));
29     end
30    
31     depthTics=depthStretch(depthTics,depthStretchDef);
32     set(gca,'YTick',depthTics);
33     set(gca,'YTickLabel',depthTicsLabel);
34    
35     %output plot handle:
36     if nargout>0; varargout={h}; end;
37    
38    
39    
40    

  ViewVC Help
Powered by ViewVC 1.1.22