I think I've found a plausible cause for this: several labels seem to
get overlaid on top of each other, and presumably the aliasing
produces some Moiré effect that messes up the edges. See the Grid call
below (rendered with quartz anyway),
library(ggplot2)
p <- # minimal example
qplot(0,0, geom="blank")+
geom_text(aes(0,0),label="Ugly text", size=10)
p # fine
p2 <-
p %+% mtcars # ugly ???
g <- # store the plot as a grob
ggplotGrob(p)
g2 <- # ugly version
ggplotGrob(p2)
str(getGrob(g,"texts", grep = T)) # one label
str(getGrob(g2,"texts", grep = T)) # 32 labels stacked on top of each other
grid.newpage()
grid.draw(textGrob("Ugly text", gp=gpar(cex=5))) # looks fine
grid.newpage()
l_ply(1:32, function(.) grid.draw(textGrob("Ugly text",
gp=gpar(cex=5)))) #looks ugly
So, returning to the initial example,
qplot(x = cyl, geom = "bar", data = mtcars) +
annotate("text", x = 6, y= 10, label = "Ugly font")
# or
qplot(x = cyl, geom = "bar", data = mtcars) +
geom_text(data=data.frame( x = 6, y= 10), map=aes(x=x, y=y), label =
"Ugly font")
seem to work fine.
HTH,
baptiste