0

我正在使用 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. 如何才能做到这一点?谢谢。

4

1 回答 1

1

有一个晦涩难懂的技巧:它需要设置pch

请参阅此答案: 在点周围放置边框

于 2013-06-02T12:57:02.697 回答