Home > atmlab > graphs > ypatch.m

ypatch

PURPOSE ^

YPATCH A patch object defined at a set of y-coordinates

SYNOPSIS ^

function hp = ypatch(xlow,xhigh,y,c,varargin)

DESCRIPTION ^

 YPATCH   A patch object defined at a set of y-coordinates

    Creates a patch object where the patch limits can be specified
    as two functions of y. 

    The edge of the patch is turned off.

    A typical application of this function is to plot the confidence
    interval around a vertical profile as a patch. If the estimated
    vector *x*, defined at *y* has the uncertainty *si*, this can be
    plotted as:
       ypatch(x-si,x+si,y,[0.8 0.8 0.8]);
       hold on
       plot(x,y);

 FORMAT   hp = ypatch(xlow,xhigh,y,c[,varargin])
        
 OUT   hp         Handle to patch object.
 IN    xlow       Low x-value for each y.
       xhigh      High x-value for each y.
       y          Y-coordinates.
       c          Color specification.
 OPT   varargin   Arguments passed on to PATCH.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

ypatch.m

SOURCE CODE ^

0001 % YPATCH   A patch object defined at a set of y-coordinates
0002 %
0003 %    Creates a patch object where the patch limits can be specified
0004 %    as two functions of y.
0005 %
0006 %    The edge of the patch is turned off.
0007 %
0008 %    A typical application of this function is to plot the confidence
0009 %    interval around a vertical profile as a patch. If the estimated
0010 %    vector *x*, defined at *y* has the uncertainty *si*, this can be
0011 %    plotted as:
0012 %       ypatch(x-si,x+si,y,[0.8 0.8 0.8]);
0013 %       hold on
0014 %       plot(x,y);
0015 %
0016 % FORMAT   hp = ypatch(xlow,xhigh,y,c[,varargin])
0017 %
0018 % OUT   hp         Handle to patch object.
0019 % IN    xlow       Low x-value for each y.
0020 %       xhigh      High x-value for each y.
0021 %       y          Y-coordinates.
0022 %       c          Color specification.
0023 % OPT   varargin   Arguments passed on to PATCH.
0024 
0025 % 2003-03-09   Created by Patrick Eriksson.
0026 
0027 
0028 function hp = ypatch(xlow,xhigh,y,c,varargin)
0029 
0030 
0031 hp = patch( [ vec2col(xlow); flipud(vec2col(xhigh)) ], ...
0032             [ vec2col(y); flipud(vec2col(y)) ], ...
0033             c, varargin{:} );
0034 
0035 set( hp, 'EdgeColor', 'none' );

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005