Happy New Year everyone.
I have what I hope is a simple-to-answer question. In the code sample
below, I'm using a tile plot to plot a continuous measure and overlaying the
plot with labels. I need to print the labels in courier, but there appears
to be no way to override the default font setting in geom_text. I've
scoured the web for clues on how to do this, but found nothing relevant.
Any help would be very much appreciated.
Ronan
---- start code snippet ----
small.df <- data.frame(scan(what=list(row=0, col=0, item="", latency=0)))
1 1 ab 0.1
1 2 bc 0.2
1 3 cd 0.3
2 1 de 0.4
2 2 ef 0.5
2 3 fg 0.6
3 1 gh 0.7
3 2 hi 0.8
3 3 ij 0.9
small.df
p <- ggplot(small.df, aes(x=row, y=col, label=item, fill=latency))
p <- p + geom_tile()
p <- p + geom_text(colour="white")
print(p)
---- end code snippet ----
--
Professor Ronan Reilly
Department of Computer Science
NUI Maynooth
Maynooth
Co. Kildare
IRELAND
t: +353-1-7083846
e: Ronan....@nuim.ie
w: http://www.cs.nuim.ie; http://cortex.cs.nuim.ie
______________________________________________
R-h...@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.
The syntax would be
p + geom_text(colour = 'white', fontfamily = 'courier')
And see the following for non-standard font faces:
@article{Rnews:Murrell+Ripley:2006,
author = {Paul Murrell and Brian Ripley},
title = {Non-Standard Fonts in {PostScript} and {PDF} graphics},
journal = {R News},
year = 2006,
volume = 6,
number = 2,
pages = {41--47},
month = {May},
url = {http://CRAN.R-project.org/doc/Rnews/},
pdf = {http://CRAN.R-project.org/doc/Rnews/Rnews_2006-2.pdf}
}
Hadley
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> To post to this group, send email to ggp...@googlegroups.com
> To unsubscribe from this group, send email to
> ggplot2+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ggplot2