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


Groups > comp.graphics.apps.gnuplot > #2570 > unrolled thread

Stacked areas

Started byNicolas Michel <be.nicolas.michel@gmail.com>
First post2014-09-01 07:39 -0700
Last post2014-09-02 02:56 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Stacked areas Nicolas Michel <be.nicolas.michel@gmail.com> - 2014-09-01 07:39 -0700
    Re: Stacked areas Karl <mail.kfr@gmx.net> - 2014-09-01 18:45 +0200
      Re: Stacked areas Nicolas Michel <be.nicolas.michel@gmail.com> - 2014-09-02 02:56 -0700

#2570 — Stacked areas

FromNicolas Michel <be.nicolas.michel@gmail.com>
Date2014-09-01 07:39 -0700
SubjectStacked areas
Message-ID<adc09c90-df99-4e2d-bc6e-88d3d715a507@googlegroups.com>
Hi,

I want to create a stacked area graph. The examples I found on the net are all based on multiple Y values for one strictly identical X value like this:

2013-09-01,3,5,12,14,3
2013-09-02,5,6,12,15,6
2013-09-03,2,4,16,12,4
2013-09-04,1,3,18,11,3
2013-09-05,3,4,15,13,6
2013-09-06,7,3,12,21,9
2013-09-07,5,4,11,18,8

But my series are formatted that way (the date value COULD be different for the different series, of some seconds of even 1/4h):

0x10000000c9c06972
28/08/2014 00:00:01,6.79
28/08/2014 00:15:01,8.21


0x10000000c9c06973
28/08/2014 00:00:01,6.96
28/08/2014 00:15:01,8.25

Here my Gnuplot script that currently draw lines:

#! /usr/bin/gnuplot
set xdata time
set style data lines
set timefmt "%d/%m/%Y %H:%M:%S"
set format x "%d/%m\n%H:%M"
set xlabel "Time"
set ylabel "Traffic %"
set yrange [0:100]
set datafile separator ","
set term png size 1920,1024
set output 'fc_stats.png'
plot for [IDX=0:3] 'fc_plot.tmp' i IDX u 1:2 w lines title columnheader(1)

-> Is it possible with that kind of value to get a stacked area?

[toc] | [next] | [standalone]


#2571

FromKarl <mail.kfr@gmx.net>
Date2014-09-01 18:45 +0200
Message-ID<lu27ln$q5d$1@news.rz.uni-karlsruhe.de>
In reply to#2570
Am 01.09.2014 16:39, schrieb Nicolas Michel:
> Hi,
> 
> I want to create a stacked area graph. The examples I found on the net are all based on multiple Y values for one strictly identical X value like this:
> 
> 2013-09-01,3,5,12,14,3
> 2013-09-02,5,6,12,15,6
> 2013-09-03,2,4,16,12,4
> 2013-09-04,1,3,18,11,3
> 2013-09-05,3,4,15,13,6
> 2013-09-06,7,3,12,21,9
> 2013-09-07,5,4,11,18,8
> 
> But my series are formatted that way (the date value COULD be different for the different series, of some seconds of even 1/4h):
> 
> 0x10000000c9c06972
> 28/08/2014 00:00:01,6.79
> 28/08/2014 00:15:01,8.21
> 
> 
> 0x10000000c9c06973
> 28/08/2014 00:00:01,6.96
> 28/08/2014 00:15:01,8.25
> 

It works with the style "filledcurve", but I say it can´t be done
without reorganizing your data, sorry.

For data without identical sampling on the abscissa like in your second
example, you´d have to copy the pairs of subsequent datasets to one file
fname1 (or duplicate the data in one file and use indexing), with no
empty line in between, and then

plot fname1 us 1:2 with filledcurve closed

This basically draws a polygon, so the abscissa values don´t have to
match. The polygon closes whenever there´s an empty line in the data, so
you unfortunately can´t just use indexing to select the pairs of
datasets from your original data.

Repeat this for each pair. To fill the area between curve and axis for
the last dataset, give the option "above x1" (or similar, check "help
filledcurve").



[toc] | [prev] | [next] | [standalone]


#2572

FromNicolas Michel <be.nicolas.michel@gmail.com>
Date2014-09-02 02:56 -0700
Message-ID<60d8fd44-4052-4153-8f1a-3dfd2bcf66b9@googlegroups.com>
In reply to#2571
Thank you.
Indeed I had to reorganise my data in another way and I was able to do it using "for" and "sum" of gnuplot ;)

Thanks

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web