0

I have 6 ggplots which I align with the arrange.grid into 3 rows. I want to create a common legend for all the plots. I read this answer from this question which explained things in a very nice way.

Add a common Legend for combined ggplots

but the problem is that the idea mentioned here will take the legend of p1.

in my case, the legend in each plot has a different scale.

i.e. p1 : 0.6 to 0.8
i.e. p2 : 1.6 to 2.2

hence this answer does not work in my case.

How can i make 1 legend that contain the scale limits of all the 6 plots.

Community
  • 1
  • 1
ifreak
  • 1,726
  • 4
  • 27
  • 45
  • Why don't you set the limits on all the scales to the same values? Also, if you make your example reproducible you'll get more help. – BrodieG Feb 15 '14 at 13:31
  • Look at the documentation for `?facet_grid(...)`. This will create a consolidated legend and arrange the plots for you. – jlhoward Feb 15 '14 at 16:34

1 Answers1

0

I think i found a workaround, which is to create a new plot which contains all the scales from the all the other plots, and use this one as the custom legend.

ifreak
  • 1,726
  • 4
  • 27
  • 45