[R] Changing font in boxplots

John Kane jrkrideau at yahoo.ca
Wed Aug 8 15:16:02 CEST 2007


I don't know if boxplot will accept a font argument.m
>From ?boxplot it is not clear.
You may need to set the par() command before the
boxplot

Example: 
par(font.lab=4)
boxplot(mass ~ family, data=mydata, ylab="mass %",
xlab="family",las=1, cex.axis=1)

--- "G Iossa, School Biological Sciences"
<G.Iossa at bristol.ac.uk> wrote:

> Hi all,
> 
> I am very new to R and this might be a simple
> question but I have looked 
> everywhere you suggest before writing to you.
> 
> I am trying to change font type from san-serif to a
> serif (Times New 
> Romans) on all labels and axis of my boxplot. I have
> used this function in 
> other plots before, e.g.:
> 
> plot(residuals~lnlifespan, data=mydata, pch=psymb,
> font=6, xlab="ln 
> reproductive lifespan", ylab="residuals ln mass",
> font.lab=6, cex=1.5, 
> cex.axis=1.5, cex.lab=1.5)
> 
> and found that font.lab or font.axis=6 gives Times
> font. However, when I 
> try for boxplot:
> 
> boxplot(mass ~ family, data=mydata, ylab="mass %",
> xlab="family", 
> font.axis=6,  font=6, par(las=1), cex.axis=1)
> 
> it does not work (R does not give any warning
> messages). I have also tried 
> family="Times" but without success. Any idea of why
> is not doing it and 
> what I can do to get Times font on my boxplot?
> I run R on Windows.
> 
> Thanks a lot,
> Graziella
> 
>
*****************************************************
> Dr. Graziella Iossa
> 
> Mammal Research Unit
> School Biological Sciences
> University of Bristol
> Woodland Road
> Bristol BS8 1UG, UK
> 
> E-mail: G.Iossa at bristol.ac.uk
> Tel 0044 (0)117 9288918
> Fax 0044 (0)117 3317985
> http://www.bio.bris.ac.uk/research/mammal/index.html
> http://www.bio.bris.ac.uk/people/Iossa.htm
> 
> ______________________________________________
> 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.
>



More information about the R-help mailing list