Visualising Whether the LibDems Side with the Tories or Labour in Parliamentary Votes

A couple of days ago, I picked up via a post on the Guardian Datablog a cluster map visualisation by the Public Whip folk comparing how MPs from the various parties have voted over the last few Governments: MP vote map (data).

The 2D chart shows clustered voting behaviour in Parliamentary votes ( divisions ) between recent elections, showing who voted with whom (e.g. did the LibDems tend to vote with Labour MPs, or Conservative MPs?).

Ever a literalist, I thought I’d have a crack at the data myself, and plot some simple coloured matrix charts of MPs vs. vote, using colour to denote whether or note the MP voted in favour of the motion, or against it.

So for example, for the 2005-2010 period, I get the following:

The top block shows Labour MPs, then Lib Dems, then Conservative MPs and finally MPs from the other parties. The x-axis is the vote, with (I think) more recent votes to the left; individual MPs go down the y-axis. Looking at a line across the screen gives the voting record for a particular MP; looking at a line going down the screen shows how folk voted on a particular vote.

Where there are long horizontal black lines showing, this is identifies MPs who were absent from votes over that period of time. If you have good eyesight, looking down the votes, we can see whether or not the parties voted the same way. I have put in a little bit of interactivity to allow exploration of the data, but I think it also needs x/y magnification to better show the votes for the selected vote and MP:

To try to make things a little easier to see, here’s a view of the map showing MPs who were marked by the Public Whip as absent from a vote (white is absent);

Hover the mouse cursor over one of the lines shows Tony Blair as being largely absent (as you might expect). A distinct white line going down the screen shows that very few people attended the vote. I need to rethink this interaction, I think, maybe showing the votes that an MP did vote at when you highlight them, and using red/green colour to show how they voted.

The next view attempts to show whether or not a particular MP voted with the majority vote of their party…

So for example, looking across the diagram to find lines (= regular dissenters), I can pick out Jeremy Corbyn, Alan Simpson and Kenneth Clarke, which the Public Whip also sees as voting against the majority view of their party. Where there are significant numbers voting against the majority view of the party, I’m guess that’s a free vote…? Or, err, there’s something a little buggy going on in the code…:-(

The app was written in Processing; for what it’s worth, I posted an edit or two ago of the code code as a gist on github.

PS I just updated the info panel to provide a little bit more detail about how a vote went:

The bottom line shows the turnout for the vote, the overall majority (-ve number means the vote wasn’t passed), then the ayes/noes for each party. If this info doesn’t match the actual vote record, I know I have a bug…:-) (or is that :-(?

One comment

  1. xerode

    Linked here by the Guardian on Twitter. Nice work, I’ll have another look when I’m not on my phone. Might even play around with the Processing if that’s cool :)