comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Longword plotting problems...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Longword plotting problems... [message #11980] Mon, 22 June 1998 00:00
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
Geraint H. Jones wrote:

>
> ; Example code
>
> time=lindgen(10)+13254100
>
> data=findgen(10)
>
> plot,time,data
>
> ; Just to show that time should increase smoothly in the plot
>
> print,time



Hmmm!?
Here is a work-around...

num_pts=10
time=lindgen(num_pts)+13254100
data=findgen(num_pts)

xticknames=strtrim(time,2)

plot, time-13254100, data, xtickname=xticknames, xticks=num_pts-1, $
/xstyle, xmargin=[9,9], ymargin=[7,7], $
xtitle='Time', ytitle='Data Values', $
title='A Decent Plot', subtitle='(Seconds since 1950)'


--
Andrew F. Loughe |
afl@cdc.noaa.gov
University of Colorado, CIRES Box 449 |
http://cdc.noaa.gov/~afl
Boulder, CO 80309-0449 | phn:(303)492-0707
fax:(303)497-7013
------------------------------------------------------------ ---------------
"I do not feel obliged to believe that the same God who has endowed us
with
sense, reason, and intellect has intended us to forego their use."
-Galileo
Re: Longword plotting problems... [message #11981 is a reply to message #11980] Mon, 22 June 1998 00:00 Go to previous message
menakkis is currently offline  menakkis
Messages: 37
Registered: June 1998
Member
"Geraint H. Jones" <g.h.jones@ic.ac.uk> wrote:
> I'm handling data files (well, trying to!) in which the time is recorded
> as the number of seconds since the beginning of 1950 (I know it's not
> the easiest format to deal with, but it's what I have to work with). In
> order to get precision to the level of seconds, I have to use longword
> arrays.
>
> This is all fine, but the problem is plotting using the longword arrays.
> Whatever plot ranges I choose, the time values in the plots are
> quantized, i.e. they do not increase smoothly, even though the values
> in the array itself increase smoothly. I've attached a short piece of
> example code below to demonstrate this...
>
> ; Example code
>
> time=lindgen(10)+13254100
>
> data=findgen(10)
>
> plot,time,data

I think that there's no way to do this the way you'd like. What's happening
is that your times are using well over 24 bits in the longwords, and the
FLOAT format can only represent integers accurately if they use about 24 bits
- any more is simply lost (from the "small end"). Unfortunately, the PLOT
routine (& friends) converts its arguments to FLOAT. A "double misfortune"
(sorry :-) - even if you pass DOUBLE arguments to PLOT, it will convert them
to FLOAT!

Perhaps you could plot offset-removed seconds across X; i.e., first subtract
the smallest time value.

(BTW, I had to use time=lindgen(10)+'0fffffff'x to get your example to really
kick.)


Peter Mason

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL Object for creating a Singleton
Next Topic: Color Postscript from Object Graphics.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 09:48:05 PDT 2025

Total time taken to generate the page: 1.83295 seconds