在ggplot2螺钉中使用scale_y_continuous,并在区域图中填充颜色

问题描述 投票:0回答:1

我正在尝试对不同类型的图(线和面)上的某些图形进行标准化,而scale_y_continuous的用法与线图完美结合,但是当我在面积图上使用完全相同的代码时,会有点麻烦。

使用线图,我使用scale_y_continuous参数

scale_y_continuous(breaks= seq(0,1,by=0.2), 
                 labels = c("0.0", 0.2, 0.4, 0.6, 0.8, "1.0"), 
                 limits = c(-0.1,1), expand = c(0,0))

and I get this as the result

所以我知道那很好。

Then I try to use the same exact argument with an area plot and it screws the plot up in a way that I don't really have precise language to describe

我不完全确定是什么在搞砸了,但是如果有人对如何纠正此错误有任何意见,我将不胜感激。

r ggplot2
1个回答
0
投票
似乎将代码简化为:

scale_y_continuous(breaks= seq(0,1,by=0.2))

© www.soinside.com 2019 - 2024. All rights reserved.