3
如何调整y轴,使注释在这种情节中也能正确显示?如何动态调整y轴范围是ggplot2?
library(ggplot2)
ggplot(diamonds, aes(x = cut, y = depth)) +
facet_wrap(~ color) +
stat_summary(fun.y = sum, geom="bar", fill = "yellow", aes(label=cut, vjust = 0)) +
stat_summary(fun.y = sum, geom="text", aes(label=cut), vjust = 0)
现在例如在小面ģ注释为“理想”未正确显示。 Y轴范围应该动态计算,这样在条上方总会有一些注释空间。所以我不能使用固定的Y轴范围。