R: How to overlay pie charts on 'dots' in a scatterplot in R R: How to overlay pie charts on 'dots' in a scatterplot in R r r

R: How to overlay pie charts on 'dots' in a scatterplot in R


Yes. pieGlyph() is one ready-to-go function from the Rgraphviz package.

Also, I would check out this Q/A for how to do things like this more generally:

How to fill a single 'pch' point on the plot with two-colours?

Especially check out ?my.symbols from the TeachingDemos package.

Lastly, in regards to ggplot2, you should check out this blog post about possible upcoming features:

http://blog.revolutionanalytics.com/2011/10/ggplot2-for-big-data.html


See also Paul Murrell. Integrating grid graphics output with base graphics output. R News, 3(2):7-12, October 2003. http://www.r-project.org/doc/Rnews/Rnews_2003-2.pdf

The code on pp 10-11 sets up the main plot axes, labels and legend, and then opens a series of smaller windows centered at each individual point on the plot and plots a small graph in each window. I've tried pie charts, mosaics and barplots, but the method is not limited to these types.