how to add a common legend to a 2 plots in a row?
2
0
Entering edit mode
carol white ▴ 680
@carol-white-2174
Last seen 9.6 years ago
European Union
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20080417/ 32828fcf/attachment.pl
• 497 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States
Hi Carol, There's undoubtedly better ways to do this (maybe with ggplots2?), but this is one way: layout(matrix(1:3, nrow=1), widths=c(1,0.5,1)) plot(1:10) plot(1:10, bty="n", xaxt="n", yaxt="n", type="n", xlab="", ylab="") legend("topright", c("here is the","legend","in the middle")) plot(1:10) see ?layout Best, Jim carol white wrote: > Hi, > How to add a common legend (a list of text, in 1 column) to 2 plots displayed by par (mfrow = c(1,2)) in a row? i don't know how to add the legend between 2 plots or for ex, in the right upper corner of the right plots in the margin of the right plots when there is no place to display the legend in the plot region (overlapping problem). Any other suggestion to place the legend is welcome. > > Regards, > > carol > > > --------------------------------- > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 4 months ago
EMBL European Molecular Biology Laborat…
17/04/2008 20:33 carol white a ?crit > Hi, > How to add a common legend (a list of text, in 1 column) to 2 plots displayed by par (mfrow = c(1,2)) in a row? i don't know how to add the legend between 2 plots or for ex, in the right upper corner of the right plots in the margin of the right plots when there is no place to display the legend in the plot region (overlapping problem). Any other suggestion to place the legend is welcome. > > Regards, > > carol Dear Carol, have a look at the "lattice" package, one of whose strengths is exactly what you've been asking for. Using it, however, is quite different from using the ordinary R plotting functions, so you will probably need to invest some time & effort learning the new way. But it's an investment that pays off very nicely! Best wishes Wolfgang ------------------------------------------------------------------ Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber
ADD COMMENT

Login before adding your answer.

Traffic: 610 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6