Re: [R] legend for several graphics

From: hadley wickham <h.wickham_at_gmail.com>
Date: Wed, 05 Mar 2008 14:21:22 -0600

On Wed, Mar 5, 2008 at 8:28 AM, Georg Otto <georg.otto_at_tuebingen.mpg.de> wrote:
> Hi,
>
> I am trying to generate a figure of 9 plots that are contained in one
> device by using
>
> par(mfrow = c(3,3,))
>
> I would like to have 1 common legend for all 9 plots somewhere outside
> of the plotting area (as opposed to one legend inside each of the 9
> plots, which the function legend() seems to generate by default).

If you provide more detail about your problem (what are the 9 plots?) I'm sure we can suggest other solutions using lattice or ggplot that will substantially simplify your code, as well as automatically drawing the legend.

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 05 Mar 2008 - 20:24:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Mar 2008 - 21:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive