I'm having trouble formatting the labels in legends when inversing a transformation. As an example, consider the following:
test <- data.frame(expand.grid(1:10, 1:10), value=runif(100, min=1, max=1000))
p <- qplot(Var1, Var2, data=test, geom='tile', fill=value)
If I where to log transform the fill scale and furthermore do something to the labels and breaks, I would add
p + scale_fill_gradient(trans='log10', guide=guide_colorbar(), breaks=trans_breaks('log10', function(x) 10^x), labels=trans_format('log10', math_format()))
The problem is that the labels are plotted as unevaluated calls and thus not very pretty... I have tried different permutations of using eval(), parse() and expression() around trans_format() without luck... Is it not possible to put expression as legend labels when dealing with scale transformations?