MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

How to display non contiguous datasets

  • To: mathgroup at
  • Subject: [mg66815] How to display non contiguous datasets
  • From: János <janos.lobb at>
  • Date: Wed, 31 May 2006 06:31:18 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Let's say I have a data source and it is adding to the existing data  
set new points in every two minutes.  The data set is in an array  
called cg0254.  Every element in that array has two values, the first  
is a time value from the epoch, the second is a real number.   
Something like this:

{3357970381, 96.2373}

Let say if I want to graph the last hour worth of data, I select a  
subset of the data with Take:

Take[cg0254, -30]

and my function for the Ticks is something like:

Ticks -> {({#1, StringJoin[ToString[ToDate[#1][[2]]], "/", ToString 
[ToDate[#1][[3]]], "\n",
        ToString[ToDate[#1][[4]]], ":", ToString[ToDate[#1][[5]]]]}  
& ) /@ Take[Take[cg0254, -30][[All,1]],
      {1, Length[Take[cg0254, -30][[All,1]]], Floor[Length[Take 
[cg0254, -30][[All,1]]]/14]}], Automatic}

that is, for tick marks I select 14 data points to avoid  the  
crowding of tick marks on the plot.  It looks OK if the plot is about  
6 inch  or more wide.

A problem occurs however if the data source for some reason stops  
emitting data - it is a computer with cron on it - and someone has to  
restart it.  Then after restart there will be a gap in the time  
value, and that gap will start to rake havoc on my data selection and  
Ticks function shown above.  I can imagine that I can scan the data  
before hand and identify the gap(s) and take the data with multiple  
Take(s) and also to modify my Ticks function to accommodate the gaps.

The question is how to graph the data, that the gaps would show up as  
two vertical lines 1/4 of the distance of two tick marks apart, with  
no data shown between these vertical lines.

I am sure someone already run into this problem and there is some  
solution for it "out there".

Any pointers are appreciated.


Trying to argue with a politician is like lifting up the head of a  
(S. Lem: His Master Voice)

  • Prev by Date: Memory Leak
  • Next by Date: Re: New Analytical Functions - Mathematica Verified
  • Previous by thread: Memory Leak
  • Next by thread: Re: applied to numeric constants