[R] ggplot2: font size mismatch for pdf output

From: Michael Friendly <friendly_at_yorku.ca>
Date: Mon, 12 May 2008 10:20:22 -0400


In the following, the graph I see on the screen and the .png output coincide. However, in the .pdf file, the fonts seem to be scaled fairly larger, resulting in the label for the top legend disappearing. Is this an infelicity or bug, or is there something I've missed?

More generally, how do I control the size of fonts used in legends and axis labels?


qp <-qplot (education , income , shape=type , size=women , colour=prestige ,

         xlab="Education" , ylab="Income", data=Prestige)     + scale_y_continuous(limits=c(NA, 20000)) qp + scale_size(to=c(1,8))

ggsave(file="prestige-ggplot.png", width=6, height=5) # OK ggsave(file="prestige-ggplot.pdf", width=6, height=5) # fonts too large


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. Received on Mon 12 May 2008 - 14:29:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 12 May 2008 - 16:30:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive