R: Creating Custom Shapes with ggplot
Posted
by
Brandon Bertelsen
on Stack Overflow
See other posts from Stack Overflow
or by Brandon Bertelsen
Published on 2011-02-07T02:00:41Z
Indexed on
2011/02/10
7:25 UTC
Read the original article
Hit count: 322
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.
© Stack Overflow or respective owner