Re: Plotting double precision [message #19105] |
Thu, 24 February 2000 00:00 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
davidf@dfanning.com (David Fanning) writes:
> Investigate some of the keywords
> that are available for the PLOT command. I would start with
> [XYZ]Tickname, [XYZ]TickV, and maybe [XYZ]Tickformat.
Yeah, and welcome to another planet of hurt. David is right though.
The best solution is to scale your data and then label the axes
yourself. Personally, I think it's actually cleaner to scale your
data by 10^(-39), and then put that in the "units" of your x/ytitle.
I've also encountered the single-precision-plotting problem when I am
plotting numbers with X = X0*(1+d) where d is very small. When d/X0
becomes smaller than about 1 in a million, you can see a noticeable
staircase effect on the plot, since single precision can't preserve
the fidelity. My only solution has been to subtract and rescale the
data.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Plotting double precision [message #19110 is a reply to message #19105] |
Thu, 24 February 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Jacques Basson (jfb37@NOSPAM.cam.ac.uk) writes:
> Does anyone know how I can plot double precision values in IDL. The plot
> routine help says:
>
> Plots created with PLOT are limited to the range and precision of
> single-precision floating-point values.
>
> Unfortunaltely, this means that values which do not lie in the
> +-10^(+-38) range can't be easily plotted. Of course as luck would have
> it, my values are of the order 10^(-39), and I'd rather not have factors
> of 10 in my labels. The other option would be to take logs before
> plotting rather than using the /ylog keyword, but I prefer the axis
> label to have the value of the variable, rather than its log.
How you plot the data and how you label the axes are
really two separate issues. They appear causally
connected only because most of us are lazy enough to let
IDL do the labelling from the data. But it doesn't have
to be that way at all. Investigate some of the keywords
that are available for the PLOT command. I would start with
[XYZ]Tickname, [XYZ]TickV, and maybe [XYZ]Tickformat.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|