Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #258

Re: Stacked boxes

From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Stacked boxes
Followup-To comp.graphics.apps.gnuplot
Date 2011-04-14 08:57 -0700
Organization gnuplot development team
Message-ID <io75h0$j67$1@dont-email.me> (permalink)
References (3 earlier) <io073b$p22$1@dont-email.me> <4da3a149$0$22212$c3e8da3$a8a65a91@news.astraweb.com> <4da6025a$0$5766$c3e8da3$e408f015@news.astraweb.com> <io56s1$err$1@dont-email.me> <io5e4q$gd2$1@dont-email.me>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | View raw


James Waldby wrote:

> On Wed, 13 Apr 2011 15:07:57 -0700, sfeam wrote:
> 
>> Mike Rhodes wrote:
>> 
>>> On 4/11/2011 8:48 PM, Mike Rhodes wrote:
>>>> On 4/11/11 8:41 PM, sfeam wrote:
>>>>> Mike Rhodes wrote:
>>>>>
>>>>> It seems like perhaps what you need to do is to treat time as a
>>>>> sequence of discrete intervals (1 second?), [...]
>>> To follow up on this, I have some example plots.
>>> 
>>> The problem with aggregating the data into coarser intervals is that it
>>> creates inaccurate amplitudes. As an example, [...]
>>> http://s3.amazonaws.com/3tbVapQP/boxes.png
>>> http://s3.amazonaws.com/3tbVapQP/seconds.png
>>> http://s3.amazonaws.com/3tbVapQP/milli.png
>>> 
>>> [...] the millisecond plot exactly maps to my input data,
>>>  but the aggregated seconds plot is inaccurate.
>>> 
>>> So to get the graph I want, I need to use millisecond precision. But
>>> the problem with remapping my boxes data into millisecond bins is the
>>> file size. In this example, the millisecond file is 250x larger than
>>> the boxes file -- and it's the exact same data, just represented
>>> differently. At that rate, a 4MB boxes file becomes a 1GB millisecond
>>> file![...]
>> Now you have a better feel for why the problem is hard :-)
>> 
>> How is the program to decide if two boxes overlap, if not by exactly the
>> same process that you are saying generates too much data? Can you think
>> of some way other to handle the data internally, other than treating
>> each "box" as a series of samples at some pre-defined interval?  I'm
>> serious in asking - if there's a clever way to do it then great,
>> otherwise it strikes me as impractical for reason you've already
>> identified.
> 
> The usual method for processing such data is to use a heap [see eg
> <http://en.wikipedia.org/wiki/Heap_%28data_structure%29> ].  One
> could dump all of the item start times and all of the item end
> times into a big heap, and then plot the heap min until heap is
> empty.  A more complicated method (idea as sketched below, might
> need a fix or two) would use a small heap, of size proportional
> to maximum box stack depth:
> 
> Suppose data lines are sorted by increasing time and each line
> contains {.t, .f, .d} fields for {time, flow, duration}, and
> heap entries contain {.t, .f} fields for {time, flow}.
> 
> (1) If heap is empty and no more items, quit.
> (2) If heap is empty, put next item x on heap as follows:
>       Make an 'up' entry, {x.t, x.f} and a 'down' entry
>       at {x.t+x.d, -x.f} and advance next.
> (3) Get min item x from heap.  If next item y has y.t <= x.t,
>     add y up and down to heap (ie, {y.t, y.f} and {y.t+y.d, -y.f})
>     and advance next.
> (4) Add x.f to current flow f and output (x.t, f) for plotting
>     (Adapt appropriately if making filled area boxes as in
>      suggestion below.  Box width equals time difference between
>      previous and current heap min item, or between current and
>      next, depending on type of plot)
> (5) Go to 1.

Thanks.  Some variant of that approach does seem likely to work.

Can anyone offer pointers to typical data sets or examples of this
type of presentation?  What is such a plot style called?
Would there typically be any information to present beyond the
3 quantities  start/stop/flow?    I imagine that each entry also  
could have at least one "type" or "class" property that might be
encoded by color.  Is that done?

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-11 13:07 -0400
  Re: Stacked boxes sfeam <sfeam@users.sourceforge.net> - 2011-04-11 10:26 -0700
    Re: Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-11 14:12 -0400
      Re: Stacked boxes sfeam <sfeam@users.sourceforge.net> - 2011-04-11 17:41 -0700
        Re: Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-11 20:48 -0400
          Re: Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-13 16:06 -0400
            Re: Stacked boxes sfeam <sfeam@users.sourceforge.net> - 2011-04-13 15:07 -0700
              Re: Stacked boxes James Waldby <not@valid.invalid> - 2011-04-14 00:12 +0000
                Re: Stacked boxes sfeam <sfeam@users.sourceforge.net> - 2011-04-14 08:57 -0700
                Re: Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-14 13:03 -0400
      Re: Stacked boxes sfeam <sfeam@users.sourceforge.net> - 2011-04-14 14:00 -0700
        Re: Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-14 17:29 -0400
          Re: Stacked boxes sfeam <sfeam@users.sourceforge.net> - 2011-04-14 15:59 -0700
            Re: Stacked boxes Mike Rhodes <M8R-1cd059@mailinator.com> - 2011-04-14 21:56 -0400

csiph-web