[BioC] Changing margins on a boxplot

Jarno Tuimala jtuimala at csc.fi
Tue Apr 22 12:03:48 CEST 2008


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



More information about the Bioconductor mailing list