I have the following code:
p_all<-plot_grid( p_as + theme(legend.position="none"),
p_cd + theme(legend.position="none"),
p_cu + theme(legend.position="none"),
p_pb + theme(legend.position="none"),
p_ni + theme(legend.position="none"),
p_zn + theme(legend.position="none"),
p_hg + theme(legend.position="none"),
p_cr + theme(legend.position="none"),
align = 'v',
hjust = 0,
ncol = 2
)
p_all2<-plot_grid( p_all, legend_b, ncol = 1, rel_heights = c(6, .2))
p_all2
grid.arrange(arrangeGrob(p_all2,
left = textGrob(label=expression(paste('mg'~g^-1~'Trockenmasse')), rot = 90, vjust = 1),
right = textGrob(label = "W (m)", rot=270, vjust =1.5)))
which produces the following graph:
I have to use plot_grid as I am using sec_axis
to display waterlevel on the second y-axis.
How can I get the last 2 plots at the bottom to have the same size as the other plots. I know that the difference is size is due to the x-axis. Is there a way to remove the x-axis also from the last two plots by using axis.title.x = element_blank()
and axis.ticks.x = element_blank()
and then adding the x-axis to a separate row right under the last two plots?