[R] Axis tick label format and rotation

hadley wickham h.wickham at gmail.com
Sun Sep 7 19:44:16 CEST 2008


Hi Kurt,

> Please tell me how to format data in a data frame so when currency amount is displayed in a chart the axis tick labels contain leading $ signs.

The easiest way is add a custom scale:
vals <- seq(0, 100, by = 10)
qplot(...) + scale_x_continuous(breaks = vals, labels = paste("$",
vals, sep = ""))

> Please also tell me if it is possible to rotate x axis labels using ggplot2.

Not easily, but there will be in the next version.

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list