I want to arrange three plots (created with ggplot2) with the same x-axis. Every plot has a different legend, which are placed on the right site outsite the plot. However, the legend (5 categories) of the top plot is higher then the plot and is therefore covered by the plot in the middle. Same is true for the bottom plot, but here the legend is not covered, because it is in the top layer I guess. My question is, how can I change the order of layers that the legend of the top plot is fully visible and overlaps the plot in the middle? I use the patchwork package to arrange plots. I included an image of my plot, but I'm not sure if it will be shown.
Code to arrange my plots: g1/g2/g3