如何通过rpy2在ggplot2中移除geom_histogram的基线?
我正在通过 rpy2 使用 ggplot2 绘制直方图,代码如下:
p = ggplot2.ggplot(df) + \
ggplot2.aes_string(x="x", colour="sample") + \
ggplot2.facet_grid(Formula("sample ~ .")) + \
ggplot2.geom_histogram(binwidth=0.3, fill="white")
效果很好,除了 geom_histogram
和 geom_density
会在直方图底部添加一根“基线”条,我想把它去掉。请问怎么才能去掉这条线呢?下面是我提到的那条线的图片,上面有箭头标注。谢谢。

1 个回答
1
这个是从条形的边缘来的。
只需要去掉 colour = "sample"
这一行就可以了。