I have used the method indicated here to align graphs sharing the same abscissa.
But I can\'t make it work when some of my graphs have a legend and others don\'t.
The patchwork package by Thomas Lin Pedersen does this all automagically:
patchwork
library(patchwork) g1 + g2 + plot_layout(ncol = 1)
Can hardly get any easier than that.