在ggplot中,如何消除轴上0以下的浪费空间?

时间:2014-01-16 20:01:30

标签: r

我想消除两个0下方图表中的死区。我该怎么做?

我不确定如何使措辞更清晰。一张图片最能解释我在寻找什么,但Stackoverflow没有让我发布一张。

我的代码是:

ggplot(data=temp,
  aes(x=s, y=SumOfAverage,))  + 
    geom_line() +
scale_x_continuous(breaks = seq(0, 1, by = 0.1),labels = percent_format())+
scale_y_continuous(breaks = seq(0, 35000, by = 1000),labels = comma_format())+
theme(axis.title.x = element_blank()) +
labs(y = "kWh")+
opts(
        panel.grid.major.x = theme_line(size = 0.1, colour = '#1391FF'),
    panel.grid.major.y = theme_line(size = 0.1, colour = '#1391FF'),
        panel.grid.minor = theme_line(colour = "lightblue"),
        panel.background = theme_rect(colour = "grey"),
        axis.ticks = theme_blank()
    )+
theme(panel.background = element_rect(fill = "grey"))

0 个答案:

没有答案