一轴移动几何条

有人可以帮助我移动/移动情节的geom_bars吗?我想远离X轴的0值,黄色,棕色和灰色这三个条,固定绿色。

这是我要修改的情节:

一轴移动几何条

我想做这样的事情:

一轴移动几何条

我的日期范围如下:

一轴移动几何条

还有我的R代码:

p <- ggplot(c,aes(x = trophic_group,y = rel.contribution,fill = trophic_group)) +

   geom_bar(aes(fill =  trophic_group),width = 1,position = position_dodge(1),stat = "identity") + 

   geom_text(aes(label = paste0(c$rel.contribution,"%")),hjust = 1.5,size=3) + 
   coord_flip() + # Flip axis
   facet_wrap(~ scenario,scales = "free") +
   theme(text = element_text(family = "Times New Roman"),panel.border = element_blank(),panel.grid.major = element_blank(),panel.background = element_blank(),panel.grid.minor = element_blank(),panel.spacing.y  = unit(2.25,"lines"),panel.spacing.x  = unit(1.5,strip.text.x = element_text(size = 12,color = "black",face = "bold"),strip.background =element_rect(fill="white"),axis.line = element_line(colour = "black"),legend.title = element_text(color = "black",size = 10,legend.text = element_text(size = 10,face = "plain"),legend.position = "bottom",# plot.title = element_text(hjust= 0.5,vjust=2,legend.key.size = unit(0.75,"line"),axis.text.x = element_text(size = 10,colour = "black",face = "plain" ),axis.text.y = element_text(size = 10,axis.title.x = element_text(size = 12,axis.title.y = element_blank()) +
   scale_fill_manual(values = c("Reef sharks"="seashell3","Generalist predators"="chocolate3","Invertivores"="darkgoldenrod1","Herbivores/Detritivores"="darkolivegreen3"),name = "Trophic guilds:")
p 
zcg234 回答:一轴移动几何条

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3106344.html

大家都在问