[BioC] OT: question about plots, general R, really...

James W. MacDonald jmacdon at med.umich.edu
Tue Jul 4 20:53:06 CEST 2006


You might also consider using the 'xpd' argument to par().

 > par(xpd = NA)
 > plot(1:10)
 > plot(1:10)
 > plot(1:10)
 > plot(1:10)
 > plot(1:10)
 > plot(1:10)
 > text(-12,28,"A header string")

The only problem with this solution is finding where to put things. An 
alternative is to use

 > text(locator(1), "A header string") and then place it where you want.

HTH,

Jim


Ana Conesa wrote:
> Hi Jose,
> 
> I came across this same problem some time ago and I figured out a quite 
> rudimentary solution, I guess. Probably there are more elgant ones (I would 
> love to know them!!!)
> Basically what I do is:
> - Split my device up into one more row, very narrow, at the upper part, to 
> host the general title, and then set my first figure to spand across this 
> first row. 
> - Then plot a "ghost" plot in which I have made everything not visible but 
> the Title. Normally you have to adjust the margins for this first "plot" in 
> advance.
> - Resest the margins
> - Plot the other plots  
> 
> For example, for a title, plus 4 figures you could use:
> 
>>layout(matrix(c(1,1,2,3,4,5),3,2, byrow=T),heights=c(1,6,6))
>>par(mar=c(0.1,0.1,2,0.1))
>>plot(0, main="Your Title", xaxt="n", yaxt="n", xlab="", 
> 
> ylab="",bty="n",col="white") 
> 
>>par(mar=c(c(4, 4, 4, 2)))
>>plot...what ever...
> 
> 
> You have to play a bit with the heights parameter of layout to get the 
> division you are happy with (the function layout.show() shows you the 
> position of each plot in your screen). And play also with the margins, maybe.
> 
> Hope this is of some use to you...
> 
> Ana
> 
> 
> On Tue, 04 Jul 2006 18:12:56 +0100, J.delasHeras wrote
> 
>>This is a bit off-topic, as it's purely R, I suppose...
>>
>>I am making figures containing 6 plots (MA plots, in this case), using:
>>
>>par(mfrow=c(2,3))
>>
>>now, I would like to add a title, for instance, to the whole figure, 
>>not to the individual plots... how does one do that? I can only seem 
>>to add text, title etc to each plot...
>>
>>thanks for any pointers!
>>
>>Jose
>>
>>-- 
>>Dr. Jose I. de las Heras                      Email: J.delasHeras at ed.ac.uk
>>The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
>>Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
>>Swann Building, Mayfield Road
>>University of Edinburgh
>>Edinburgh EH9 3JR
>>UK
>>
>>_______________________________________________
>>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
> 
> 
> --
> IVIA (http://www.ivia.es)
> Open WebMail Project (http://openwebmail.org)
> Debian Project (http://www.debian.org)
> 
> _______________________________________________
> 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
University of Michigan
Affymetrix and cDNA Microarray Core
1500 E Medical Center Drive
Ann Arbor MI 48109
734-647-5623



**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.



More information about the Bioconductor mailing list