Error bars in ln-space with PLOTERROR [message #55731] |
Mon, 03 September 2007 18:09 |
willettk
Messages: 20 Registered: October 2006
|
Junior Member |
|
|
This is less an IDL question than a mathy one, but I've been banging
my head on it for a while without a solution - thank god for
newsgroups. I want to use PLOTERROR to give me a scatter plot in lin-
log space, with error bars in the y-direction. The quantities I want
to plot are x vs. ln(y), so I can't use the /ylog keyword (since that
gives me base10 logarithms, which I don't want). I can't figure out,
however, how to do proper error bars.
Here's an example:
;;;;;
pro ll_plot
x = indgen(10)
y = indgen(10)
y_err = 1d-2 * indgen(10)
ploterror, x, ln(y), ln(y_err)
end
;;;;;
In this case, PLOTERROR is plotting the y-values as ln(y) +/-
ln(y_err), while I want it to plot ln(y +/- y_err). Using the above
code gives error bars that are orders of magnitude larger than the
true error (the problem actually gets worse with smaller error bars).
Does anyone know of how to make PLOTERROR behave when plotting natural
logs with error bars (or some blindingly obvious thing that I'm doing
wrong)?
Many thanks.
|
|
|