문제

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.

도움이 되었습니까?

해결책

There is an obscure trick: it requires to set pch

See this answer: Place a border around points

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top