Using R I would like to replace the points in a 2d scatter plot by a pie chart displaying additional values.
The rational behind is that I have time series data for hundreds of elements (proteins) derived from a biological experiment monitored for 4 conditions. I would like to plot the elements (categorial data) on the y axis and occurrence of a event in time on the x axis. To visualize the relative occurrence between the 4 conditions I would like to visualize this in form of a pie chart or doughnut chart overplayed onto the respective point in the scatter plot. The overall data density is low so overlapping won't be an issue.
Is this possible in R? I was thinking of using a manual scale in ggplot2 but could not figure out how to define a pie chart as a scale.
Also of interest would be how to best cluster this data and sort it accordingly.
ggplot
you would have to write ageom_pie
-- at present pie charts inggplot
are implemented via a coordinate transformation, which only works if you want to plot a single pie per facet ... – Ben Bolker