R: shared legend from a subplot to the 2x2 grid.arrange panel with Lattice [duplicate]
问题 This question already has answers here : Global legend using grid.arrange (gridExtra) and lattice based plots (3 answers) Closed 2 years ago . I am working on this question here to get a legend from a subplot of 2x2 plots to its whole window. The goal is to get a single legend and then remove the other legends, only one legend is enough and that should be positioned on the right of the whole pane. Perhaps relevant Global legend using grid.arrange (gridExtra) and lattice based plots Code