Exact Positioning of multiple plots in ggplot2 with grid.arrange

后端 未结 1 2027
被撕碎了的回忆
被撕碎了的回忆 2021-01-05 14:26

I\'m trying to create a multiple plot with the same x-axis but different y-axes, because I have values for two groups with different ranges. As I want to control the values

1条回答
  •  一生所求
    2021-01-05 14:50

    Do:

    install.packages("cowplot")
    

    but do not library(cowplot) as it'll mess up your theme work.

    Then, do:

    grid.arrange(
      arrangeGrob(cowplot::plot_grid(plot.treat, plot.control, align = "v", ncol=1),
                  ncol = 1,
                  left = textGrob("Aggregierte Depositen (in Tausend US$)", 
                                  rot = 90,
                                  vjust = 1,
                                  gp = gpar(fontfamily = "Times",
                                            size = 12,
                                            colout = "black",
                                            fontface = "bold")),
                  bottom = textGrob("Jahr",
                                    vjust = 0.1,
                                    hjust = 0.2,
                                    gp = gpar(fontfamily = "Times",
                                              size = 12,
                                              colout = "black",
                                              fontface = "bold"))))
    

    0 讨论(0)
提交回复
热议问题