Re: [R] Multiple plots with one legend

From: jim holtman <jholtman_at_gmail.com>
Date: Sun, 27 Mar 2011 07:11:14 -0400

Here is how to do the legend:

x <- cbind(rbind(1,2,3), 4)
layout(x, width = c(5,1))
layout.show(4)

plot(1:10, type = 'l')
plot(1:10, type = 'l')
plot(1:10, type = 'l')

# reset margins for creating the legend
oldMar <- par(mar = c(0,0,0,0))
plot.new()
legend('center'

    , legend = 1:10
    , lwd = 3
    , col = 1:10

    )
par(oldMar)

On Sun, Mar 27, 2011 at 12:43 AM, mavkoup <mavkoup_at_hotmail.com> wrote:
> Yes that's what I had managed to generate too. I can produce my 3 plots. Each
> plot has 10 colored lines say. I want to place the legend in the 4th spot
> listing the name of the 10 colored lines, and their color.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Multiple-plots-with-one-legend-tp3408537p3408850.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

______________________________________________
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 Sun 27 Mar 2011 - 11:14:14 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 Sun 27 Mar 2011 - 14:00:25 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