Re: xrange woes [message #54911] |
Wed, 18 July 2007 21:17  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Josh <joshuamontague@gmail.com> writes:
> this is a new one for me...
> i'm plotting data points (~50) that are spread over a small x range
> (relative to the values). these data points lie at values around
> 2,000,000, but are spread over a range of about 0.01. I can use
> xrange=[x1,x2] up until the difference between x2 and x1 is about
> 0.25. If I try to make the range smaller, it is just ignored (and
> left at ~0.25) until the range decreases to 0.1 at which point the
> plotted x range jumps to ~30! The xstyle keyword follows the same
> pattern (works until the range is ~0.25, then is ignored).
>
> Has anyone else ever had this happen? Is there some limitation on how
> small xrange can be given the actual xvalues? btw, these data points
> have legitimate values to the standard double precision accuracy.
I always understood the IDL direct-graphics system to be limited to
single precision, even if your data is double precision.
Try subtracting the mean value and see if it works.
Craig
|
|
|
Re: xrange woes [message #54920 is a reply to message #54911] |
Wed, 18 July 2007 11:02   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Josh writes:
> this is a new one for me...
> i'm plotting data points (~50) that are spread over a small x range
> (relative to the values). these data points lie at values around
> 2,000,000, but are spread over a range of about 0.01. I can use
> xrange=[x1,x2] up until the difference between x2 and x1 is about
> 0.25. If I try to make the range smaller, it is just ignored (and
> left at ~0.25) until the range decreases to 0.1 at which point the
> plotted x range jumps to ~30! The xstyle keyword follows the same
> pattern (works until the range is ~0.25, then is ignored).
>
> Has anyone else ever had this happen? Is there some limitation on how
> small xrange can be given the actual xvalues? btw, these data points
> have legitimate values to the standard double precision accuracy.
I don't know. This works perfectly for me:
IDL> data = dindgen(51) * 0.0001 + 2000000D
IDL> Window, XSIZE=1200, YSIZE=500
IDL> plot, data, time, xstyle=1, xtickformat='(f20.6)'
IDL> print, data[50] - data[0]
0.0049999998
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: xrange woes [message #54987 is a reply to message #54911] |
Thu, 19 July 2007 13:26  |
Josh
Messages: 21 Registered: June 2007
|
Junior Member |
|
|
On Jul 18, 10:17 pm, Craig Markwardt
<craigm...@REMOVEcow.physics.wisc.edu> wrote:
> Josh <joshuamonta...@gmail.com> writes:
>> this is a new one for me...
>> i'm plotting data points (~50) that are spread over a small x range
>> (relative to the values). these data points lie at values around
>> 2,000,000, but are spread over a range of about 0.01. I can use
>> xrange=[x1,x2] up until the difference between x2 and x1 is about
>> 0.25. If I try to make the range smaller, it is just ignored (and
>> left at ~0.25) until the range decreases to 0.1 at which point the
>> plotted x range jumps to ~30! The xstyle keyword follows the same
>> pattern (works until the range is ~0.25, then is ignored).
>
>> Has anyone else ever had this happen? Is there some limitation on how
>> small xrange can be given the actual xvalues? btw, these data points
>> have legitimate values to the standard double precision accuracy.
>
> I always understood the IDL direct-graphics system to be limited to
> single precision, even if your data is double precision.
> Try subtracting the mean value and see if it works.
>
> Craig
Thanks Craig, I was able to use both xrange and xstyle by subtracting
most of the value from all of the points.
-Josh
|
|
|