我有一幅图,其中y轴以百分数为单位进行转换;我想对其设置限制,只显示较高的百分比(从50%到100%),但它不起作用:
ggplot(myData,aes(x=A_factor, y=some_numeric_data, fill=factor(Another_factor))) +
geom_bar(position = position_fill(reverse = TRUE),stat = "identity", color="white") +
scale_y_continuous(labels = scales::percent, limits=c(50,100))我也尝试使用标签= percent_format。
谢谢。
发布于 2017-08-31 12:09:26
标签背后的值是十进制表示形式。你的限制应该在0到1之间。在你的情况下:
limits = c(0.5, 1)https://stackoverflow.com/questions/45981097
复制相似问题