hadley/ggplot2 — pull request #730 by cjp39 (2012-12-03 12:56:40+00:00)
Title: Apply scale transformations in stat_function

stat_function is ignoring scale transformations when passing arguments to its function.

For example,

```R
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.