Question

I have these data example:

(cur | prev) 01:22, 30 March 2011? Sergio (Talk | contribs)? . . (20,789 bytes) (+4)? . . (>?VoIP)
(cur | prev) 01:23, 31 March 2011? Sergio (Talk | contribs)? . . (20,790 bytes) (+1)? . . (>?VoIP)
(cur | prev) 01:25, 01 April 2011? Sergio (Talk | contribs)? . . (20,950 bytes) (+160)? . . (>?VoIP)
(cur | prev) 10:15, 05 April 2011? Tcatm (Talk | contribs)? . . (21,028 bytes) (+78)? . . (>?Virtual goods)
(cur | prev) 12:43, 06 April 2011? Doood (Talk | contribs)? . . (21,173 bytes) (+145)? . . (>?Home)
(cur | prev) 12:43, 08 April 2011? Doood (Talk | contribs)? . . (21,162 bytes) (-11)? . . (>?Home)
....

I would like to draw historical graph. I must have on the x-axis dates in months and on the y-axis count of lines. Example: x-axis = "March" y-axis = "2" x-axis = "April" y-axis = "4 + April (and months before)".

How can I do this by gnuplot?

Was it helpful?

Solution

This can be achieved using the smooth cumulative option when plotting:

set xdata time
set timefmt "%B %Y"
set format x "%B %Y"
set xtics 24*60*60*30
plot "data" u 6:(1.0) smooth cumulative with lp pt 7

As timefmt I use only the full month name and the year and ignore the day so that all data points in March are added up, then for April all data points from March and April are summed up etc. With the above data you get the following output image:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top