[R] Limiting size of pairs plots

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Aug 28 13:43:16 CEST 2007


>From ?pairs

      The graphical parameter 'oma' will be set by 'pairs.default'
      unless supplied as an argument.

so try

pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species", pch = 21,
       bg = c("red", "green3", "blue")[unclass(iris$Species)],
       oma = c(8,3,5,3))



On Tue, 28 Aug 2007, Sébastien wrote:

> Dear R-users,
>
> I would like to add a legend at the bottom of pairs plots (it's my first
> use of this function). With the plot function, I usually add some
> additional space at the bottom when I define the size of the graphical
> device (using mar); grid functions then allows me to draw my legend as I
> want.
> Unfortunatley, this technique does not seem to work with the pairs
> function as the generated plots use all the available space on the
> device (see below). I guess I am missing a key argument... my attempts
> to modify the oma, mar, usr arguments were unsuccesfull, and I could not
> find any helpful threads on the archives.
>
> As usual, any advice would be greatly appreciated
>
> Sebastien
>
>
> pdf(file="C:/test.pdf", width=6, height= 6 + 0.2*6)
>
> par(mar=c(5 + 6,4,4,2)+0.1)
>
> pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species", pch = 21,
> bg = c("red", "green3", "blue")[unclass(iris$Species)])
>
> dev.off()
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list