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

Home » Public Forums » archive » Re: How to handle gaps in plot?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to handle gaps in plot? [message #45118 is a reply to message #45113] Thu, 11 August 2005 09:40 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
caitouer wrote:
> Thanks for your quick reply. It is true that it is easy when you have
> filled the gap with some values. However, I am trying to figure out
> how to plot when you do not fill the gap. Here is an example:
>
> X (time):[1,2,3,5,6,7,10,11,12,19,20,21,22,23,24]
> ;Hourly data in one day. There are several gaps in the data
> ;array. You do not know when you will have gap nor
> ; how large the gap is. The actual data is not so regular and
> ;huge. So it is not practical to fill the data.
>
> Y (some values):
> [1.1,0.9,1.3,1.6,2.1,0.7,2.3,0.1,0.3,0.6,0.9,1.4,1.3,1.7,1.8 ]
> ; these are the measurements you take at above time.
>
> Then when you type:
> plot,x,y
> There will have lines between the intervals. However, these lines are
> meaningless.
>
> I just want know if we plot the valid intervals only without those
> extra lines.

Ahh... so you don't actually have invalid data in these gaps, just irregularly spaced data. The
simplest solution is to use the PSYM keyword to plot just symbols and no connecting lines at all
(since the lines between the regular, hourly data are also meaningless... at least depending on the
variabiliy of your data).

Another option would be to create a regularly spaced array of x-data (based on yout x(time) data),
copy in the y-data to a simialrly spaced array and fill the y-data gaps with !values.d_nan. E.g.

IDL> x=dindgen(20)
IDL> y=dindgen(20)
IDL> y[5:8]=!values.d_nan
IDL> plot, x, y

Insty-gap in the data plot.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Speeding Up Oracle DataBase Access with IDL DataMiner
Next Topic: Re: Check if a point is inside a polygon mesh

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

Current Time: Sat Oct 11 02:32:08 PDT 2025

Total time taken to generate the page: 2.46390 seconds