[R] plot question

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jul 3 21:30:54 CEST 2005


At least on Windows XP R 2.1.1 it does seem like there is quite a 
difference to me, at least when done side by side, which can be 
seen like this:

plot(rnorm(10),rnorm(10),xlab="",ylab="")
title(xlab="x",ylab=quote(bold(3*"4")),font.lab=1,cex.lab=1.25,col.lab="blue")

since the cex.lab will act on both 3 and "4" but bold will only act on
the "4" since numbers such as 3 in the example are ignored by bold.
Maybe in isolation it would suffice.

On 7/3/05, John Wilkinson (pipex) <wilks at dial.pipex.com> wrote:
> 
> Gabor,
> 
> I thought that I had worked around the 'expression' format problem,
> but if the x-y labels are to be bold, then using,say, cex.lab=1.25    in the
> title(), appears to simulate 'bold' font very well, both for the ylab maths
> expression and xlab text.
> 
> Your solution is the rigorous one!
> 
> John
> 
> for example --
> 
> plot(rnorm(10),rnorm(10),xlab=" ",ylab=" ")
> title(xlab="year",
> ylab=expression(paste("M x"*10^{3})),font.lab=1,col.lab=4,
> cex.lab=1.25)
> 
> 
> Gabor Grothendieck wrote ---
> 
> Trying characters and expressions variously it seems that font.lab applies
> to character strings but not to expressions so if you want to use an
> expression
> just use bold (or whatever) explicitly on the expression.  One gotcha is
> that
> bold will not work as one might have expected on numbers so they must
> be represented as character strings -- which is why we have used "3" rather
> than 3 below.
> 
> plot(rnorm(10),rnorm(10),xlab=quote(bold(year)),ylab=quote(bold("Mx10"^"3"))
> )
> 
> On 7/2/05, alex diaz <celebridades at megamail.pt> wrote:
> > dear list:
> >
> > in the following plot:
> >
> > plot(rnorm(10),rnorm(10),xlab="year",ylab=expression
> > (paste('M x'*10^{3},)),font.lab=2)
> >
> > font.lab=2, but xlab and ylab are different. I want
> > both labels in the same way. help?
> >
> > a.d.
> >
> 
> 
>




More information about the R-help mailing list