首页 > 解决方案 > 左右对齐考克斯图

问题描述

我在对齐两个地块时遇到问题。如果我选择axis = "r"它完全向右对齐,如果我选择axis =“l”,它完全向右对齐,但是,我不能让它两边都对齐。有小费吗?

  plot_grid(p1, p2, ncol = 1,align = "v",axis = "r",rel_heights = c(4, 0.4))

在此处输入图像描述

p2 <- ggplot(val.m,aes(variable,Row)) +   geom_point(aes(colour=value)) +
  scale_color_manual(values=c("white","black")) + facet_wrap(~GO) + theme_classic(base_size = 8) +
  theme(panel.background = element_rect(fill = NA, color = "black")) +
  theme(strip.background = element_blank(),
    strip.text.x = element_blank())

p1 <- ggplot(df, aes(x=Comparison, reorder(V2,logFC))) + 
  geom_tile(colour="black", size=0.25, aes(fill=logFC)) +
  scale_fill_gradient2(low="#2171b5",mid="white",high="#ef6548") + 
  theme_classic(base_size = 8) +                           
  theme(axis.text.x = element_text(angle = 45,hjust = 1)) + 
  facet_grid(~GO) + 
  geom_point( aes( x = Comparison, y = V2, size= AveExpr),shape=1) +
  scale_size("Expression\n(cpm, log2)",range=c(0,2)) +
  labs(y="Gene") +
  theme(panel.background = element_rect(fill = NA, color = "black"))

标签: rggplot2cowplot

解决方案


推荐阅读