Hi ggploters,
Full Disclosure: Cross posted on SO
(http://stackoverflow.com/questions/4917570/r-creating-custom-shapes-with-ggplot)
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.
TIA,
-- Brandon Bertelsen Office: 647-722-0481 Cell: 647-287-1009
It seems like you could use a combination of geom_path()
and geom_segment() since you either know or can
reasonably guesstimate the coordinate locations for each major
point on your graph/chart/thingamajigger up there. Maybe
something like this would work? The data.frame that was
constructed contains the outline of the shape above (I opted for
the rectangle at the top...I'm sure you could find an easy way
to generate the points to approximate a circle if you really
wanted. Then use geom_segment() to divvy up that
large shape as you need.
df <- data.frame(
x = c(-8,-4,4,8,-8, -8, -8, 8, 8, -8)
, y = c(0,18,18,0,0, 18, 22, 22, 18, 18)
, group = c(rep(1,5), rep(2,5)))
qplot(x,y, data = df, geom = "path", group = group)+
geom_segment(aes(x = 0, y = 0, xend = 0, yend = 12 )) +
geom_segment(aes(x = -6.75, y = 6, xend = 6.75, yend = 6)) +
geom_segment(aes(x = -5.25, y = 12, xend = 5.25, yend = 12)) +
geom_segment(aes(x = -2, y = 12, xend = -2, yend = 18)) +
geom_segment(aes(x = 2, y = 12, xend = 2, yend = 18)) +
geom_text(aes(x = -5, y = 2.5), label = "hi world")
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2