Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Stacked boxes Followup-To: comp.graphics.apps.gnuplot Date: Thu, 14 Apr 2011 14:00:44 -0700 Organization: gnuplot development team Lines: 71 Message-ID: References: <4da3355c$0$12295$c3e8da3$aae71a0a@news.astraweb.com> <4da344aa$0$5610$c3e8da3$10cdda79@news.astraweb.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Thu, 14 Apr 2011 21:00:55 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="joalffpZlyHxFtpFd/PRrw"; logging-data="18354"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197EwwHt4G1ChXE0EjWKNoK" User-Agent: KNode/4.4.3 Cancel-Lock: sha1:cTridLvGOCywfvO+4glp1cPxG/k= Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:261 Mike Rhodes wrote: > On 4/11/2011 1:26 PM, sfeam wrote: >> Mike Rhodes wrote: >> >>> Hello, >>> >>> I have an issue I've been trying to use AWK to get around but I've ended >>> up here to ask about a feature implementation. >>> >>> I am trying to use boxes to plot total throughput from netflow data. I >>> like the fact that I can specify the width of the box -- I set that to >>> the duration of the flow. But my frustration comes from the fact that >>> the boxes do not stack when they overlap. Instead, they overlay each >>> other. This only allows me to graph the maximum single-flow throughput, >>> rather than total throughput at any given time. Does anyone know if >>> there are any plans for box stacking in future versions of gnuplot? >> >> Is it possible that you are looking for one of the stacked histogram >> modes? E.g. plots 5-7 in >> >> http://gnuplot.sourceforge.net/demo/histograms.html > > That's not quite what I'm looking for. The variable width of the box is > a crucial piece of data in the plots I'm doing. > >> If that's not what you had in mind, could you post a link to some >> plot somewhere that is in the style you are thinking of? > > Here is a sample plot: > http://s3.amazonaws.com/3tbVapQP/box_overlay_example.png > > This is the data: > > 1302350771.016 0.003040 1.752 > 1302350788.681 0.047432 4.548 > 1302350792.845 0.032472 1.120 > 1302350792.901 0.021536 0.172 > 1302350793.217 0.023680 0.420 > 1302350800.717 0.025024 0.492 > 1302350814.777 0.001248 0.000 > 1302350814.781 0.001248 0.020 > 1302350823.701 0.019568 0.228 > 1302350830.432 0.000832 0.096 > > Notice how, in the box just after 6:30, there is one box inside another? > What I'm looking for it to do is to jump up above the existing box, so > that it shows the total throughput at that time (the sum of the > overlapped boxes) instead of just the largest box. After thinking about what would need to be added to gnuplot to produce the plot you ask for, I have decided that it is possible already with a slight change to the input data format. As I understand it, your data above consists of 3 entries Time(midpoint) height Time(width) If you split each line into records instead: Time(start) height Time(end) -height then the following command produces the plot you want: plot 'data' using 1:2 smooth cumulative with steps output is here: http://tinyurl.com/3nncaet