【发布时间】:2021-11-01 17:00:23
【问题描述】:
我知道这可能不是最好的例子,但我想在 x 轴上方添加 x 变量 (lstat) 的分布,如示例图中所示。我提供了 MWE 的数据和简单折线图的代码。
但是,到目前为止,我还没有关于如何实现这一点的线索。有什么提示吗?
library(ggplot2)
library(mlbench)
data(BostonHousing)
ggplot(data = BostonHousing) +
geom_line(aes(x = lstat, y = medv))
Example Plot 表示 x 轴上方的频率刻度:
【问题讨论】:
标签: r ggplot2 frequency-distribution