[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying error bars

This is a situation where I would say that you might as well roll your own -
it's not as hard as it sounds.  Something like the following, after you plot
your data (x,y):

for i=0,n_elements(x) do begin
    plots, [x[i]-err[i],x[i]+err[i]] , [y[i],y[i]] , color=0,thick=2 ; draw the
horiz. error bar
    plots, [x[i]-err[i],x[i]-err[i]] ,
[y[i]+0.02*!c.yrange,y[i]-0.02*!c.yrange] , color=0,thick=2 ;make some little
tick marks on the ends if you want
    plots, [x[i]+err[i],x[i]+err[i]] ,
[y[i]+0.02*!c.yrange,y[i]-0.02*!c.yrange]] , color=0,thick=2


(Not sure if the !c.yrange part is correct.) You also should probably use
Postscript output, that way you have more control over the final result's
format and appearance.

- Med

"Miklos Z. Kiss" wrote:

> Is there an easy way to create horizontal error bars in IDL plots?  Also, I
> recently discovered that the IDL routine ERRPLOT does not allow you change
> the color of the error bars.  I typically do plots in black on a white
> background (so I can copy the image into documents, etc.), rendering the
> error bars invisible.  Is there a way around this too?