Political GD::Graph fun!

Ovid on 2006-08-10T22:06:51

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.


What gives with the dates?

jdavidb on 2006-08-11T16:52:21

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

Re:What gives with the dates?

Ovid on 2006-08-11T17:03:22

Whoops! I screwed up my sorting. I'll fix that when I get home. Thanks! That might make the graph much smoother.

Re:What gives with the dates?

jdavidb on 2006-08-11T19:31:46

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. ;) It's the international standard, you know. And DateTime makes it easy. :)

Re:What gives with the dates?

Ovid on 2006-08-11T20:49:44

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, 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.

Re:What gives with the dates?

Ovid on 2006-08-11T17:41:41

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