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:
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 =
Hi,
I've created 3 plots one under the other, and want to include a legend on
the right that spans the height of all 3 plots.
How can I do this?
Thanks!
--
View this message in context:
http://r.789695.n4.nabble.com/Multiple-plots-with-one-legend-tp3408537p3408537.html
Sent from the R help
On Mar 26, 2011, at 7:06 PM, mavkoup wrote:
Hi,
I've created 3 plots one under the other, and want to include a
legend on
the right that spans the height of all 3 plots.
?mtext
# with the `las` parameter for rotation
Or you can use:
text(x,y, some text, srt=-90,xpd=NA )
--
David
Ok I think I can figure that out. Which leads me to a further question. My 3
plots contain 10 time series, each with a different name and color. Can I
create the legend such that it has a line of the correct color follow by the
name of the series? I.e.
line(with color1) NAME 1
line(with color2)
On Mar 26, 2011, at 8:27 PM, mavkoup wrote:
Ok I think I can figure that out. Which leads me to a further
question. My 3
plots contain 10 time series, each with a different name and color.
Can I
create the legend such that it has a line of the correct color
follow by the
name of the
You can use 'layout' to create 4 plot areas: the 3 plot you currently
have, and one for the legend. Try this to see what happens:
x - cbind(rbind(1,2,3), 4)
layout(x, width = c(5,1))
layout.show(4)
On Sat, Mar 26, 2011 at 7:06 PM, mavkoup mavk...@hotmail.com wrote:
Hi,
I've created 3
7 matches
Mail list logo