![]() |
iTool User's Guide: Working with Plots |
![]() |
Error bars are used to show uncertainty in data values. These uncertainties may be caused by measurement errors or instrument noise, and are usually specified in terms of standard deviations away from the data value.
For example, to create a 2D plot with asymmetric error bars on the X and Y axes, follow these steps:
err = FLTARR(2,10) err[0, *] = FINDGEN(10)/10. err[1, *] = FLTARR(10) + 0.5
iPlot, FINDGEN(10), COLOR = [255, 0, 255],$ ERRORBAR_COLOR = [255, 0, 0], $ ERRORBAR_CAPSIZE = 0.25, X_ERRORBARS = 0, $ XERROR = err, YERROR = err
Also, to create a 3D plot with asymmetric error bars on the X, Y and Z axes:
nVerts = 30 x = FINDGEN(nVerts)/10. y = (SIN(x*2) + 1.)*25. z = x err = FLTARR(2, nVerts) err[0, *] = RANDOMU(seed, nVerts) err[1, *] = RANDOMU(seed, nVerts)
iPlot, x, y, z, COLOR = [0, 0, 255], $ THICK = 2, ERRORBAR_COLOR = [255, 0, 0], $ XERROR = err/2., YERROR = err*5., ZERROR = err, $ NAME = '3D Plot with Error Bars'
For more information on error-bar properties, see Plot.
IDL Online Help (March 01, 2006)