Re: probability scale on 2D line plot? [message #13798] |
Fri, 11 December 1998 00:00 |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
Embarassed by my previous, useless post, I'll duel with the Send button
again.
I guess you're really after something similar to IDL's log scaling in
functionality, but with the remapping done according to a cumulative
normal distribution. You can't do this with a simple switch in the
PLOT call (as with log scaling); you have to do it by steam power...
Say you have a vector DAT(N) that you want to plot stretched in this
way. You also have the mean DAV and the standard deviation DSD of the
underlying distribution. (Maybe you just calculate these from DAT.)
First you have to decide how much to stretch - how many standard
deviations to cover. Say you pick 3.
The stretched data is: DAT1=GAUSSINT( (DAT-DAV)/(3.0*DSD) ).
Then you just use DAT1 instead of DAT in the plot call.
However, the plot's axis labels would now be "wrong". You could come
right by doing something like this:
NT=6 ;6 ticks, say
TVAL=( FINDGEN(NT) * ((6*DSD)/(NT-1)) ) - 3*DSD ;over -3SD..3SD
TVAL1=GAUSSINT( (TVAL-DAV)/(3.0*DSD) ) ;stretch them
Then in the plot call:
PLOT, DAT1, ... YTICKS=NT-1, YTICKV=TVAL1, YTICKNAMES=STRTRIM(TVAL,2)
If you wanted "correct" DATA cursor readouts from your plot, you'd have
to handle their *inverse* mapping.
Peter Mason
|
|
|
Re: probability scale on 2D line plot? [message #13800 is a reply to message #13798] |
Thu, 10 December 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Peter Mason (p.mason@syd.dem.csiro.au) writes:
> Embarassed by my previous, useless post, I'll duel with the Send button
> again.
Funny. I thought I just *received* an article that started out
like this. I must be working too hard. :-(
Cheers,
David
P.S. Peter, I *always* learn something from your posts. Even
if it takes several days sometimes. Keep 'em coming, Mate. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: probability scale on 2D line plot? [message #13810 is a reply to message #13800] |
Thu, 10 December 1998 00:00  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
Charlotte DeMott wrote:
> Does anyone know how to create a "probability axis" for a
> line plot? This is an axis that runs from nearly zero to
> nearly 1, that is stretched at each end, such that the
> cumulative distribution of a normal population appears as a
> straight line.
I think that you can use IDL's GAUSSINT() function to do this.
e.g., X = GAUSSINT( (findgen(N)-(N-1.0)*0.5) / ((N-1.0)/(SD*2.0)) ) will
give you what you want over +/- SD standard deviations (N points
worth). You would then use such an X vector in your plot, instead of
just a straight findgen-style X vector.
Peter Mason
|
|
|