0

I want to plot a legend outside my plot area.
I used par(mfrow = c(2,2), oma = c(2,2,2,8), xpd = T) function to try to make a space for my legend in the right area but I get a blank space on every plot and not in the whole image.

Thanks for your help.

llrs
  • 3,308
  • 35
  • 68
JM88
  • 457
  • 3
  • 6
  • 11
  • 4
    I want to avoid an answer as R's base `plot` functionalities are not exactly great. I warmly recommend you to consider using `ggplot2` where legends / and multiplots are much easier facilitated: for legends see http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/ and for facetting see http://www.cookbook-r.com/Graphs/Facets_(ggplot2)/ – CMichael Jan 17 '14 at 13:38
  • 5
    If you really need to stick with the base functionality this discussion seems to point in the right direction: http://stackoverflow.com/questions/3932038/plot-a-legend-outside-of-the-plotting-area-in-base-graphics?rq=1 – CMichael Jan 17 '14 at 13:39
  • Hi thanks for the answers.I checked the thread CMiachael but it is not working for my problem because I have various plots within my image. – JM88 Jan 21 '14 at 15:19

0 Answers0