Plot Asymmetric Error Bars Idl
Contents |
Toolkit APIs ENVI API ESE API Libraries Astronomy Library Beaumont Library Bowman Library Catalyst Library Coyote Library Dáithí Library Galloy Library JBIU Library JHUAPLS1R Library idl oploterr Mankoff Library Markwardt Library Motley Library Salvaggio Library ENVI Using ENVI idl errorplot Modules Atmospheric Correction DEM Extraction ENVI Photogrammetry Feature Extraction (FX) NITF ENVI API ESE Using ENVI Services idl ploterr Engine ENVI Services Engine API ENVI for ArcGIS@ Services Edition Resources Licensing PDF Guides Platform Support Harris Geospatial/Docs Center/IDL Reference/New Graphics/ERRORPLOT ERRORPLOT ERRORPLOT The ERRORPLOTfunction draws a simple line plot, ploterror idl with error bars surrounding each vertex. You can create plots with both symmetric and asymmetric error bars. Example The following lines create the plot shown at the right. y = [20.1, 19.9, 20.0, 20.0, 19.9, 20.0] yerror = [0.329, 0.186, 0.147, 0.086, 0.234, 0.196] x = INDGEN(6)+1 ; Create the plot p = ERRORPLOT(x, y, yerror, XRANGE=[0,7], $
Idl Errplot
XTITLE="Day", YTITLE="Distance (miles)", $ TITLE="Average distance bears walk in a day") ; Set some properties p.THICK=2 p.ERRORBAR_THICK=2 p.SYM_COLOR ="cornflower" p.ERRORBAR_COLOR="indian_red" p.ERRORBAR_CAPSIZE=0.5 Additional Examples See Plot examples for additional examples using the ERRORPLOTfunction. Syntax graphic = ERRORPLOT(Y, Yerror [, Format] [, Keywords=value] [, Properties=value]) graphic = ERRORPLOT(X, Y, Xerror, Yerror [, Format] [, Keywords=value] [, Properties=value]) graphic = ERRORPLOT(X, Y, Yerror [, Format] [, Keywords=value] [, Properties=value]) Keywords Keywords are applied only during the initial creation of the graphic. AXIS_STYLE=value /BUFFER, /CURRENT, /DEVICE, DIMENSIONS=[width, height], LAYOUT=array, LOCATION=[x, y], MARGIN=scalar or [left, bottom, right, top], /NO_TOOLBAR, /NODATA, /OVERPLOT, /WIDGETS Properties Properties can be set as keywords to the function during creation, or retrieved or changed using the "." notation after creation. ANTIALIAS, ASPECT_RATIO, AXES, BACKGROUND_COLOR, BACKGROUND_TRANSPARENCY, CLIP, COLOR, CROSSHAIR, ERRORBAR_CAPSIZE, ERRORBAR_COLOR, ERRORBAR_LINESTYLE, ERRORBAR_THICK, FILL_BACKGROUND, FILL_COLOR, FILL_LEVEL, FILL_TRANSPARENCY, FONT_COLOR, FONT_NAME, FONT_SIZE, FONT_STYLE, HIDE, LINESTYLE, NAME, POSITION, RGB_TABLE, SYM_COLOR, SYM_FILLED, SYM_FILL_COLOR, SYM_INCREMENT, SYMBOL, SYM_SIZE, SYM_THICK, SYM_TRANSPARENCY, THICK, TITLE, TRANSPARENCY, UVALUE, VERT_COLORS, WINDOW, WINDOW_TITLE, XRANGE, YRANGE Methods Close ConvertCoord CopyWindow Delete Erase GenerateCode GetData GetValueAtLocation MapForward MapInverse Order Print
Toolkit APIs ENVI API ESE API Libraries Astronomy Library Beaumont Library Bowman Library Catalyst Library Coyote Library Dáithí Library Galloy Library JBIU Library JHUAPLS1R Library Mankoff Library Markwardt Library Motley Library Salvaggio Library ENVI Using ENVI Modules Atmospheric Correction DEM Extraction ENVI Photogrammetry Feature Extraction (FX) NITF ENVI API ESE Using ENVI Services Engine ENVI Services Engine API ENVI for ArcGIS@ Services Edition Resources
Oploterror Idl
Licensing PDF Guides Platform Support Harris Geospatial/Docs Center/Libraries/AstroLib/OPLOTERROR OPLOTERROR OPLOTERROR Name OPLOTERROR Purpose idl horizontal error bars Over-plot data points with accompanying X or Y error bars. Explanation For use instead of PLOTERROR when the plotting system has already been defined. psym idl Calling Sequence oploterror, [ x,] y, [xerr], yerr, [ /NOHAT, HATLENGTH= , ERRTHICK =, ERRSTYLE=, ERRCOLOR =, /LOBAR, /HIBAR, NSKIP = , NSUM = , /ADDCMD, ... OPLOT keywords ] Inputs http://www.harrisgeospatial.com/docs/ERRORPLOT.html X = array of abscissas, any datatype except string Y = array of Y values, any datatype except string XERR = array of error bar values (along X) YERR = array of error bar values (along Y) Optional Input Keyword Parameters /ADDCMD = Set this keyword if you want to add this command to a cgWindow. /NOHAT = if specified and non-zero, the error bars are drawn http://www.harrisgeospatial.com/docs/oploterror.html without hats. HATLENGTH = the length of the hat lines used to cap the error bars. Defaults to !D.X_VSIZE / 100). ERRTHICK = the thickness of the error bar lines. Defaults to the THICK plotting keyword. ERRSTYLE = the line style to use when drawing the error bars. Uses the same codes as LINESTYLE. ERRCOLOR = String (e.g. 'red') or scalar integer (0 - !D.N_TABLE) specifying the color to use for the error bars. See CGCOLOR() for a list of possible color names. See http://www.idlcoyote.com/cg_tips/legcolor.php for a warning about the use of indexed color NSKIP = Positive Integer specifying the error bars to be plotted. For example, if NSKIP = 2 then every other error bar is plotted; if NSKIP=3 then every third error bar is plotted. Default is to plot every error bar (NSKIP = 1) NSUM = Number of points to average over before plotting, default = !P.NSUM The errors are also averaged, and then divided by sqrt(NSUM). This approximation is meaningful only when the neighboring error bars have similar sizes. /LOBAR = if specified and non
probably out of luck here, given what goes in the IDL distribution. error bars But others have run up against this problem, too. Check out the routines PlotErrorand OplotErr in the NASA Astronomy Library. These routines have modified the standard IDL routines to allow plot asymmetric error error bars in either direction. Moreover, the routines have additional options, such as NAN value recogntion, plotting only every nth error bar, and the NSum keyword that make them even more useful. Error bars can also be created on plots using the ERR_* keywords available on the cgPlot command. You can find IDL code and see an example of this in the Errorbar_Plot example in the Coyote Plot Gallery. [Return to IDL Programming Tips] Copyright © 1997-2013 David W. Fanning Last Updated 10 December 2013
the plot shown at the top of this topic. y = [20.1, 19.9, 20.0, 20.0, 19.9, 20.0] yerror = [0.329, 0.186, 0.147, 0.086, 0.234, 0.196] x = INDGEN(6)+1 ; Create the plot plot = ERRORPLOT(x, y, yerror, XTITLE="Day", $ YTITLE="Distance (miles)", $ TITLE="Average distance bears walk in a day") ; Set some properties plot.MIN_VALUE = 0 plot.THICK=2 plot.SYM_INDEX="D" plot.SYM_COLOR ="cornflower" plot.ERRORBAR_COLOR="indian_red" plot.ERRORBAR_CAPSIZE=0.5 Additional Examples See Plot examples for additional examples using the ERRORPLOTfunction. Syntax graphic = ERRORPLOT(Y, Yerror, [Format]) graphic = ERRORPLOT(X, Y, Xerror, Yerror, [Format]) graphic = ERRORPLOT(X, Y, Yerror, [Format]) Methods Close Method ConvertCoord Method CopyWindow Method GetSelect Method Order Method Print Method Refresh Method Rotate Method Save Method Scale Method Select Method Translate Method Return Value The ERRORPLOTfunction returns a reference to the created graphic. Use the returned reference to manipulate the graphic after creation by changing properties or calling methods. Arguments X A vector representing the abscissa values to be plotted. If X is not specified, Y is plotted as a function of point number (starting at zero). If both arguments are provided, Y is plotted as a function of X. This argument is converted to double precision floating-point before plotting. Plots created with PLOT are limited to the range and precision of double-precision floating-point values. Y The ordinate data to be plotted. This argument is converted to double-precision floating-point before plotting. Xerror Either a vector or a 2 x N array of error values to be displayed as error bars for the X dimension of the plot. The length of this array must be equal in length to the number of vertices of the plot. If the argument is a vector, each value will be used as both a negative and positive error and the error bar will be symmetric about the plot vertex. If the argument is a 2 by N array, the [0, *] values define the negative error and the [1, *] values define the positive error, resulting in asymmetric error bars. Use the scalar value 0 to not draw X error bars. Yerror Either a vector or a 2 by N array of error values to be displayed as error bars for the Y dimension of the plo