为什么 geom_density 在密度图中向我显示高于 1 的值?如何将其更改为分数?
我的代码用来生成情节
ggplot(data = input2, aes(x = r.close)) +
geom_density(aes(y = ..density.., fill = `Próba`), alpha = 0.3, stat = "density", position = "identity") +
xlab("y") + ylab("density") +
theme_bw() +
theme(plot.title=element_text(size = rel(1.6), face = "bold"),
legend.position = "bottom",
legend.background = element_rect(colour = "gray"),
legend.key = element_rect(fill = "gray90"),
axis.title = element_text(face = "bold", size = 13))