Re: [R] legend placement

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Thu, 10 Apr 2008 07:07:37 -0400

Ng Stanley wrote:

> Hi,
>
> I am plotting 5 charts using p <- par(mfrow = c(3, 2), how can I place my
> legend in the last region ? I don't wan to put it into the margin.

You should be able to do a blank plot, then plot the legend. For example,

> par(mfrow=c(3,2))
> for (i in 1:5) plot(1)
> plot(1, axes=F, xlab="", ylab="", type="n")
> legend("center", pch=1, legend="points")

Duncan Murdoch



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 Thu 10 Apr 2008 - 11:12:13 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 Thu 10 Apr 2008 - 11:30:27 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