Plot a simple graph of CPAN Tester counts

Corion edited this page Apr 11, 2011 · 1 revision

Plotting a simple graph is easy. Let's take the number of CPAN test reports, as found on http://stats.cpantesters.org/interest.html. We want to use the third column as the X axis (timeline) and the first column as the Y axis:

> perl -aF\s+ -nle print+join+qq(\t),@F[2,0]
199908  1
200708  500000
200803  1000000
200806  1500000
200808  2000000
200811  2500000
200901  3000000
200904  3500000
200906  4000000
200907  4500000
200908  5000000
200910  5500000
200911  6000000
201001  6500000
201004  7000000
201006  7500000
201008  8000000
201009  8500000
201010  9000000
201011  9500000
201012  10000000
201102  10500000
201103  11000000
201104  11434751

Now, let's just plot this data with ffeedflotr.pl:

> perl -aF\s+ -nle print+join+qq(\t),@F[2,0] | perl -w ffeedflotr.pl

For convenience, let's save that data in a file:

> perl -aF\s+ -nle print+join+qq(\t),@F[2,0] >cpantesters.txt

Now, let's tell the flot library that our X-axis is a time series, by adding the --time parameter:

> perl -w ffeedflotr.pl --time <cpantesters.txt

Let's fill the line below the graph:

> perl -w ffeedflotr.pl --time --fill <cpantesters.txt

Add a label to our series, just for the case when we want to add more series, like CPAN distributions uploaded etc.:

> perl -w ffeedflotr.pl --time --fill --xlabel "CPAN Test Results" <cpantesters.txt