special symbols

34 views
Skip to first unread message

s...@z107.de

unread,
Jun 5, 2009, 3:19:14 PM6/5/09
to ggplot2
hi,

with normal plot it is possible to use special symbols for
male and female by selecting "sans serif" as font:

text(x,y,"\\MA",vfont=c("sans serif","bold")) # male symbol
text(x,y,"\\VE",vfont=c("sans serif","bold")) # female symbol

Is this also possible with ggplot2?

I would like to use this symbols in the title and the legend.

thank you!

best regards,

stefan

hadley wickham

unread,
Jun 5, 2009, 3:36:27 PM6/5/09
to s...@z107.de, ggplot2
See scale_shape_manual. Eg:

df <- data.frame(x = runif(10), y = runif(10), sex =
sample(c("m","f"), 10, rep = T))
qplot(x, y, data = df, shape = sex, size = I(5)) +
scale_shape_manual(values = c("m" = "\u2642", f = "\u2640"))

Hadley
--
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages