Monday, May 28, 2012

Again on polar/star/pie charts

Haven't had much time to devote to new visualisations, mostly because work and baby have taken the precedence.

But I just wanted to take a few minutes to share the latest version of the script I showed last time.

It now saves to a pdf file, but that's not the largest change. I actually included one more slice which is obtained from the others with a formula (e.g. average, or geometrical mean, in this case the sum) and is used to rank the pies accordingly. The new value is represented as a white wedge on top of everything else, with its value pasted over it. The script wraps compounds and fit only a limited number per page, then moves on to the next one




There are a lot of things which may be changed, such as having the value as a bubble at the centre rather than a new wedge, to conserve the pies' proportionality... Or just showing the 'score' in a corner of the plot, with other info at the bottom... None of this is implemented as of yet, sorry. The code commented-out shows some graphics alternatives which I did try and set aside for the moment.
Code follows:

1 comment:

  1. That's a very interesting idea. I do prefer the idea of putting the sorting value outside the pie. The geom_text function makes such additions to plots easy when they're in Cartesian coordinates, but I'm sure it'll get strange in polar! You may have to play with the angle argument. Or is it possible put a Cartesian layer on top of a polar one? I've never tried that.

    Cheers,
    Bob Muenchen

    ReplyDelete