Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Thursday August 10, 2006
05:06 PM

Political GD::Graph fun!

[ #30588 ]

Someone wanted to see a graph of Bush's approval rating and Blair's approval rating overlapping one another, so I made one. It uses the GD::Graph module and I've included full source code in the post.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm seeing the following dates, in order:

    • 2005/1/22
    • 2005/10/10
    • 2005/10/2
    • 2005/10/26
    • 2005/11/1
    • 2005/11/15
    • 2005/11/4
    • 2005/12/11
    • 2005/12/18
    • 2005/12/8
    • 2005/4/9
    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Whoops! I screwed up my sorting. I'll fix that when I get home. Thanks! That might make the graph much smoother.

      • Looks better. :) For the record, the bug in sorting wasn't at all obvious to me until I started personally typing the dates myself. I thought you had incompatible data, like poll data with a date that was only a quarter or something.

        Should've used ISO 8601 [wikipedia.org]. ;) It's the international standard, you know. And DateTime makes it easy. :)

        --
        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • You know, I should have thought of that :) I've thought about packaging some of that stuff up into a module that would make it easy to graph out multiple date ranges, but I saw two problems. One, I can't imagine that anyone else would care (of course, I also released Games::Maze::FirstPerson [cpan.org], so that's a silly thing to say). Two, unless I can find good sources of similar data, there's not much point in me creating a module to manipulate data I can't find.

    • It's fixed. It didn't make the graph smoother, but clearly did shift some data points.