Question

I'm making the following simple plot with ggplot using rpy2:

from rpy2.robjects.lib import ggplot2
from rpy2.robjects import r, Formula
# R iris dataset
iris = r('iris')
p = ggplot2.ggplot(iris) + \
    ggplot2.geom_point(ggplot2.aes_string(x="Sepal.Length", y="Sepal.Width", colour="Sepal.Width"), fill="white") + \
    ggplot2.facet_wrap(Formula('~ Species'), ncol=2, nrow = 2) 
p.plot()

It all works except the fill="white" part. I'd like the fill to be white for all the points while the colour (i.e. the point border colour) to be set by Sepal.Width. How can this be done? thanks.

Was it helpful?

Solution

There is an obscure trick: it requires to set pch

See this answer: Place a border around points

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top