我正在使用 rpy2 用 ggplot 制作以下简单的情节:
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()
除了fill="white"
部分之外,这一切都有效。我希望所有点的填充为白色,而颜色(即点边框颜色)由Sepal.Width
. 如何才能做到这一点?谢谢。