Home > hiswa > extcontour.m

extcontour

PURPOSE ^

EXTCONTOUR extended contouring package.

SYNOPSIS ^

function [CS,H]=extcontour_jef(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20);

DESCRIPTION ^

  EXTCONTOUR extended contouring package.
        EXTCONTOUR(Z) is a contour plot of matrix Z treating the values in Z
        as heights above a plane.
        EXTCONTOUR(X,Y,Z), where X and Y are vectors, specifies the X- and Y-
        axes used on the plot. X and Y can also be matrices of the same
        size as Z, in which case they specify a surface in an identical
        manner as SURFACE.
        EXTCONTOUR(Z,N) and EXTCONTOUR(X,Y,Z,N) draw N contour lines, 
        overriding the default automatic value.
        EXTCONTOUR(Z,V) and EXTCONTOUR(X,Y,Z,V) draw LENGTH(V) contour lines 
        at the values specified in vector V.
     
        Following the numeric arguments can be a number of string arguments
        'label' to add annotation, followed by a (optional) numerical
                argument that sets the label spacing in 'points' (default 144)
        'fill' to do a block fill
        e.g., EXTCONTOUR(...,'label');
        and any number of property/value pairs where the properties are
        text properties (beginning with 'Font...' or 'Rotation') or line 
        properties (beginning with 'line...' or 'color'). Color and
        linetype can also be specified as in the PLOT command.
        e.g., EXTCONTOUR(...,'fontsize',8,'linewidth',3,'--r');

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [CS,H]=extcontour_jef(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11, ...
0002                            arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20);
0003 %  EXTCONTOUR extended contouring package.
0004 %        EXTCONTOUR(Z) is a contour plot of matrix Z treating the values in Z
0005 %        as heights above a plane.
0006 %        EXTCONTOUR(X,Y,Z), where X and Y are vectors, specifies the X- and Y-
0007 %        axes used on the plot. X and Y can also be matrices of the same
0008 %        size as Z, in which case they specify a surface in an identical
0009 %        manner as SURFACE.
0010 %        EXTCONTOUR(Z,N) and EXTCONTOUR(X,Y,Z,N) draw N contour lines,
0011 %        overriding the default automatic value.
0012 %        EXTCONTOUR(Z,V) and EXTCONTOUR(X,Y,Z,V) draw LENGTH(V) contour lines
0013 %        at the values specified in vector V.
0014 %
0015 %        Following the numeric arguments can be a number of string arguments
0016 %        'label' to add annotation, followed by a (optional) numerical
0017 %                argument that sets the label spacing in 'points' (default 144)
0018 %        'fill' to do a block fill
0019 %        e.g., EXTCONTOUR(...,'label');
0020 %        and any number of property/value pairs where the properties are
0021 %        text properties (beginning with 'Font...' or 'Rotation') or line
0022 %        properties (beginning with 'line...' or 'color'). Color and
0023 %        linetype can also be specified as in the PLOT command.
0024 %        e.g., EXTCONTOUR(...,'fontsize',8,'linewidth',3,'--r');
0025 %
0026 
0027 % Author: Rich Pawlowicz (IOS)  rich@ios.bc.ca
0028 %         12/12/94
0029 
0030 % ***modified 2/14/95 by jlist to call extclabel_jef instead of extclabel if
0031 % "loglabel" is an argument instead of "label"
0032 
0033 % Option defaults
0034 
0035 do_label=0;
0036 do_loglabel=0;
0037 do_fill=0;
0038 
0039 % Parse options
0040 numarg_for_call=['arg1'];
0041 linarg_for_call=[];
0042 textarg_for_call=[];
0043 
0044 ii=2;
0045 while (ii<=nargin),
0046  arg=eval(['arg' int2str(ii)]);
0047  if (isstr(arg)),
0048    xarg=[arg '       '];
0049    if (lower(xarg(1:3))=='lab'),
0050     do_label=1;
0051     if (ii<nargin),    % Check if label interval set
0052       if ~isstr(eval(['arg' int2str(ii+1)])),
0053         ii=ii+1;
0054         textarg_for_call=[textarg_for_call ',''' arg ''',arg' int2str(ii)];
0055       end;
0056     end;
0057 %**section added jlist 2/14/95:
0058    elseif (lower(xarg(1:3))=='log'),
0059     do_loglabel=1;
0060     if (ii<nargin),    % Check if label interval set
0061       if ~isstr(eval(['arg' int2str(ii+1)])),
0062         ii=ii+1;
0063         textarg_for_call=[textarg_for_call ',''' arg ''',arg' int2str(ii)];
0064       end;
0065     end;
0066 %**end added section
0067    elseif (lower(xarg(1:3))=='fil'),
0068     do_fill=1;
0069    elseif (lower(xarg(1:3))=='lin' | lower(xarg(1:3))=='col'),
0070      ii=ii+1;
0071      linarg_for_call=[linarg_for_call ',''' arg ''',arg' int2str(ii) ];
0072    elseif (lower(xarg(1:3))=='fon' | lower(xarg(1:3))=='rot' ),
0073      ii=ii+1;
0074      textarg_for_call=[textarg_for_call ',''' arg ''',arg' int2str(ii)];
0075    elseif ( length(arg)<=3 ),
0076      colr=isletter(arg);
0077      if any(colr),
0078        linarg_for_call=[linarg_for_call ',''color'',''' arg(colr) '''' ];
0079      end;
0080      if any(~colr),
0081        linarg_for_call=[linarg_for_call ',''linestyle'',''' arg(~colr) '''' ];
0082      end;
0083    else
0084      error(['invalid argument ' eval(['arg' int2str(ii)])]);
0085    end;
0086  else  % numerical argument
0087    numarg_for_call = [numarg_for_call ',arg' int2str(ii) ];
0088  end;
0089  ii=ii+1;
0090 end;
0091 
0092 % Do the calls
0093 
0094 % Preserve hold state at exit
0095 holdon=ishold;
0096 
0097 if (do_label | do_loglabel | do_fill ),
0098  if do_fill,
0099    eval(['[CS,H]=contourfill(' numarg_for_call ');']);
0100    hold on;
0101  end;
0102  if do_label,
0103    eval(['CS=contoursurf(' numarg_for_call ');']);
0104    eval(['H=extclabel(CS' linarg_for_call textarg_for_call ');']);
0105    hold off;
0106  end;
0107 %**section added jlist 2/14/95
0108  if do_loglabel,
0109    eval(['CS=contoursurf(' numarg_for_call ');']);
0110    eval(['H=extclabel_jef(CS' linarg_for_call textarg_for_call ');']);
0111    hold off;
0112  end;
0113 %**end added section
0114 else         % The standard option
0115  eval(['CS=contoursurf(' numarg_for_call ');']);
0116  k=1;
0117  eval(['H=plot(CS(1,k+[1:CS(2,k)]),CS(2,k+[1:CS(2,k)])' linarg_for_call ');']);
0118  k=k+1+CS(2,k); 
0119  while (k<size(CS,2)),
0120   eval(['H=[H;line(CS(1,k+[1:CS(2,k)]),CS(2,k+[1:CS(2,k)])' linarg_for_call ')];']);
0121   k=k+1+CS(2,k);
0122  end;
0123 end;
0124 
0125 
0126 if (holdon), hold on; else hold off; end;
0127 
0128 
0129 
0130 
0131

Generated on Wed 30-Nov-2005 15:36:39 by m2html © 2003