R: Creating Custom Shapes with ggplot
- by Brandon Bertelsen
Full Disclosure: This was also posted to the ggplot2 mailing list. (I'll update if I receive a response)
I'm a bit lost on this one, I've tried messing around with geom_polygon but successive attempts seem worse than the previous.
The image that I'm trying to recreate is this, the colours are unimportant, but the positions are:
In addition to creating this, I also need to be able to label each element with text.
At this point, I'm not expecting a solution (although that would be ideal) but pointers or similar examples would be immensely helpful.
One option that I played with was hacking scale_shape and using 1,1 as coords. But was stuck with being able to add labels.
The reason I'm doing this with ggplot, is because I'm generating scorecards on a company by company basis. This is only one plot in a 4 x 10 grid of other plots (using pushViewport)
Note: The top tier of the pyramid could also be a rectangle of similar size.