Intuitively I'm looking for something like:
facet_(scales="free_color")
p <- ggplot(mpg, aes(year, displ, color=model)) + facet_wrap(~manufacturer)
p + geom_jitter()
model
manufacturer
I'm not sure that this is an available option when you're colouring by a factor. However, a quick way to produce the individual plots would be something like this:
d_ply(mpg, .(manufacturer), function(df) {
jpeg(paste(df$manufacturer[[1]], ".jpeg", sep=""))
plots <- ggplot(df, aes(year, displ, color=factor(model))) + geom_jitter()
print(plots)
dev.off()
})
Related Answers: Different legends and fill colours for facetted ggplot?