R ggplot2 change scale to log

June 2, 2010 by · Leave a Comment
Filed under: Notes 

Use “trans” argument in scale_[type]_gradient function.

E.g: for scale_fill_gradient
ggplot(data = cleandatazip) + geom_boxplot(aes(x = State, y = losssevresid, color = beltindicator, fill = liqinstate)) + scale_fill_gradient(low = 1, high = 0,trans = "log10")