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


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

Re: Stacked boxes

From James Waldby <not@valid.invalid>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Stacked boxes
Date 2011-04-14 00:12 +0000
Organization A noiseless patient Spider
Message-ID <io5e4q$gd2$1@dont-email.me> (permalink)
References (2 earlier) <4da344aa$0$5610$c3e8da3$10cdda79@news.astraweb.com> <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>

Show all headers | View raw


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.

> Here's another thought.
> Would it be acceptable to represent your data as a heat map? That is,
> instead of coding throughput as a height on y, code it as a fractional
> intensity.  Draw each box as a filled area with the x dimension as it is
> now, the y dimension arbitrary, and the translucency of the box equal to
> some fractional value.  Boxes that overlap will produce a darker color.
...

-- 
jiw

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