如何摆脱Y轴与ggplot

时间:2016-06-19 07:45:40

标签: r ggplot2

我在下面的这个图中使用了以下美学:

p<- ggplot(cpp, aes(x = Num_Good, y = TTB, group = key.related.sheet, color = cutoff)) +

      geom_line() + geom_point()+  #to show the dots

      labs(title="Coherent", x="Number of wanted", y="TTB") +
      scale_x_continuous(breaks = c(0,500,1500, 3000, seq(5000,max(x),10000)),
                         labels = c(0,500,1500, 3000, seq(5000,max(x),10000)))+

      # scale_y_continuous(breaks = seq(min(TTB),max(TTB),0.2),
      #                    labels = seq(min(TTB),max(TTB),0.2))+

      scale_y_continuous(breaks = seq(-1,2,0.25),
                         labels = seq(-1,2,0.25))+
      scale_colour_discrete(guide = FALSE)

      p+  geom_hline(yintercept = 0, colour="black", linetype = "longdash")+
      geom_hline(yintercept = 0.5, colour="black", linetype = "longdash")+
      geom_hline(yintercept = 1.0, colour="black", linetype = "longdash")+

      coord_cartesian(ylim=c(-0.5, 1.5))+


      coord_cartesian(xlim=c(0, 30000))

我现在想要摆脱实际图形和Y轴之间的空白区域(左侧的虚线)。我还想制作三条宽阔的线条,空间更宽,尺寸更薄。我怎样才能做到这一点?

enter image description here

0 个答案:

没有答案