Changing margins on a boxplot
1
0
Entering edit mode
Al Ivens ▴ 270
@al-ivens-1646
Last seen 10.2 years ago
Hi, I am generating a multiple boxplot for my data, and trying to include several pieces of information for each box along the x axis. I can generate the labels fine, but can not increase the margins to enable me to see them all. I am used to using margins=c(5,8) or similar, but this does not work for box plots as far as I can see. I tried passing: ...,pars="margins=c(5,8)",... to the boxplot command line, but to no avail. Is there a simple way of doing it? Cheers and thanks for any guidance! a R version 2.6.2 (2008-02-08) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
• 6.4k views
ADD COMMENT
0
Entering edit mode
Jarno Tuimala ▴ 140
@jarno-tuimala-1650
Last seen 10.2 years ago
Hi! You can set margins to boxplot (or any plot for that matter) by first setting the graphical parameters, e.g.: par(mar=c(0,0,0,0)) # Removes margins par(mar=c(5,4,4,2)+0.1) # Default par(mar=c(8,8,4,2)) # Larger bottom and left margins and then calling the boxplot function: boxplot(rnorm(100)) You can do this using the pars -argument in the boxplot command, also, e.g.: boxplot(n, pars=list(par(mar=c(0,0,0,0)))) - Jarno On Tue, 22 Apr 2008, Al Ivens wrote: > Hi, > > I am generating a multiple boxplot for my data, and trying to include > several pieces of information for each box along the x axis. I can > generate the labels fine, but can not increase the margins to enable me > to see them all. I am used to using > > margins=c(5,8) > > or similar, but this does not work for box plots as far as I can see. I > tried passing: > > ...,pars="margins=c(5,8)",... > > to the boxplot command line, but to no avail. > > Is there a simple way of doing it? > > Cheers and thanks for any guidance! > > a > > > > R version 2.6.2 (2008-02-08) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United > Kingdom.1252;LC_MONETARY=English_United > Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > > > > -- > The Wellcome Trust Sanger Institute is operated by Genome Research > Limited, a charity registered in England with number 1021457 and a > company registered in England with number 2742969, whose registered > office is 215 Euston Road, London, NW1 2BE. > > _______________________________________________ > 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 > ---------------------------------------------------------------------- ------- Jarno Tuimala, PhD, bioinformatics, CSC, P.O.Box 405, FI-02101 Espoo, Finland tel.: +358 9 457 2226, fax: +358 9 457 2302, e-mail: jarno.tuimala at csc.fi CSC is the Finnish IT Center for Science, http://www.csc.fi/molbio
ADD COMMENT
0
Entering edit mode
Many thanks, just the trick! a > -----Original Message----- > From: Jarno Tuimala [mailto:jtuimala at csc.fi] > Sent: 22 April 2008 11:04 > To: Al Ivens > Cc: 'bioc' > Subject: Re: [BioC] Changing margins on a boxplot > > > Hi! > > You can set margins to boxplot (or any plot for that matter) > by first setting > the graphical parameters, e.g.: > > par(mar=c(0,0,0,0)) # Removes margins > par(mar=c(5,4,4,2)+0.1) # Default > par(mar=c(8,8,4,2)) # Larger bottom and left margins > > and then calling the boxplot function: > > boxplot(rnorm(100)) > > You can do this using the pars -argument in the boxplot > command, also, e.g.: > > boxplot(n, pars=list(par(mar=c(0,0,0,0)))) > > - Jarno > > > On Tue, 22 Apr 2008, Al Ivens wrote: > > > Hi, > > > > I am generating a multiple boxplot for my data, and trying > to include > > several pieces of information for each box along the x axis. I can > > generate the labels fine, but can not increase the margins > to enable > > me to see them all. I am used to using > > > > margins=c(5,8) > > > > or similar, but this does not work for box plots as far as > I can see. > > I tried passing: > > > > ...,pars="margins=c(5,8)",... > > > > to the boxplot command line, but to no avail. > > > > Is there a simple way of doing it? > > > > Cheers and thanks for any guidance! > > > > a > > > > > > > > R version 2.6.2 (2008-02-08) > > i386-pc-mingw32 > > > > locale: > > LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United > > Kingdom.1252;LC_MONETARY=English_United > > Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 > > > > attached base packages: > > [1] stats graphics grDevices utils datasets methods base > > > > > > > > > > -- > > The Wellcome Trust Sanger Institute is operated by Genome Research > > Limited, a charity registered in England with number 1021457 and a > > company registered in England with number 2742969, whose registered > > office is 215 Euston Road, London, NW1 2BE. > > > > _______________________________________________ > > 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 > > > > -------------------------------------------------------------- > --------------- > Jarno Tuimala, PhD, bioinformatics, CSC, P.O.Box 405, > FI-02101 Espoo, Finland > tel.: +358 9 457 2226, fax: +358 9 457 2302, e-mail: > jarno.tuimala at csc.fi CSC is the Finnish IT Center for > Science, http://www.csc.fi/molbio > -------------------------------------------------------------- > --------------- > -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
ADD REPLY

Login before adding your answer.

Traffic: 860 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