Message-ID: <CADv2QyH3S2aO9bamBjfnRKg5FRsHqGrCnz0e3z7nU=wkV3ko9w@mail.gmail.com>
Date: 2011-10-04T16:08:09Z
From: Dennis Murphy
Subject: ggplot2: expression() in legend labels?
In-Reply-To: <20111004155913.GA4149@CasperVector>
Hi:
Here's a reproducible example:
d <- data.frame(grp = factor(rep(c('x', 'y'), each = 5)),
ev = rnorm(10), dv = rnorm(10))
labl <- list(expression(italic('x')), expression(italic('y')))
ggplot(d, aes(x = ev, y = dv, shape = grp)) + geom_point() +
scale_shape_manual('Group', breaks = levels(d$grp),
values = 1:2,
labels = labl)
HTH,
Dennis
On Tue, Oct 4, 2011 at 8:59 AM, Casper Ti. Vector
<caspervector at gmail.com> wrote:
> Hmm, that's my fault when composing this mail, but the problem was
> really encountered at that time.
> Nevertheless, neither can I reproduce the problem now, perhaps I just
> made another mistake at that time.
> Thanks all the same, and sorry for the disturbance anyway :|
>
> On Tue, Oct 04, 2011 at 10:10:56AM -0500, Hadley Wickham wrote:
>> You need to set the labels...
>
> --
> ? ?Using GPG/PGP? Please get my current public key (ID: 0xAEF6A134,
> valid from 2010 to 2013) from a key server.
>
>
> ______________________________________________
> R-help at r-project.org 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.
>
>