R:ggplot中的面积图

时间:2016-07-14 09:46:19

标签: r graph ggplot2

我有这段代码:

 ggplot(ann_sard,aes(x = Var1, y = value, fill=Var2, group=Var2)) +
  geom_area(aes(fill=Var2),position = "identity",alpha=0.5)+
   geom_line(aes(ymax=value), position="identity")+
    scale_fill_manual(values=c("darkgray"))+
     labs(x="Tempo(anni)",y="Biomassa (t.)",title="Landings annuali")+
      theme_bw()+ theme(panel.border = element_blank(), panel.grid.major =   element_blank(),
       panel.grid.minor = element_blank(), axis.line = element_line(colour = "black"))

结果是: enter image description here

现在,我如何直接从x和y轴开始绘图,在区域图和轴之间没有“空格”?像这样举例如: enter image description here

0 个答案:

没有答案