shapes in geom_dotplot

1,379 views
Skip to first unread message

Paul

unread,
Mar 29, 2014, 6:56:22 PM3/29/14
to ggp...@googlegroups.com
Hi,
I'd like to use ggplot2 to create some dotplots but I'm hoping to define marker shapes instead of just circle.  I read some posts back in 2012 about possibly this being implemented but I don't see it.  Can anyone offer advice on how to implement this, maybe by editing the source code myself?  I'd like to setup shapes by group (something like fill=group but shape=group), mostly so it can be printed black & white and the group can be differentiated by something other than color.

Thanks for any advice!

Paul

unread,
Apr 1, 2014, 2:37:27 PM4/1/14
to ggp...@googlegroups.com
anyone?

Paul

unread,
Apr 1, 2014, 4:35:30 PM4/1/14
to ggp...@googlegroups.com
Mher replied with what should have been an obvious solution but I was stuck thinking inside of the options for geom_dotplot, but geom_point works great!  Thanks!  What he suggested is:

ggplot(mtcars, aes(x = factor(vs), y = mpg)) + geom_point(aes(shape=factor(cyl)), position=position_dodge(width=0.3), size=3)
Reply all
Reply to author
Forward
0 new messages