stat_function is ignoring scale transformations when passing arguments to its function.
qplot(1:10, log10(1:10)) + stat_function(fun=function(x) x)
qplot(1:10, log10(1:10)) + stat_function(fun=function(x) x) + scale_x_log10()
In the first plot, the function y=x sits far above the data points. After applying the scale transformation, the function now crosses the data points.
This patch fixes this bug.
Apply scale transformations before and after calling function in stat…
Could you please rebase/merge against master, re-document with the development version of roxygen2 (install_github("klutometis/roxygen) and resubmit?