Domanda

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.

È stato utile?

Soluzione

There is an obscure trick: it requires to set pch

See this answer: Place a border around points

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top