Apply scale transformations in stat_function #730

Closed
wants to merge 1 commit into
from

2 participants

@chrisalice

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

For example,

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.

@hadley
Owner

Could you please rebase/merge against master, re-document with the development version of roxygen2 (install_github("klutometis/roxygen) and resubmit?

@hadley hadley closed this Feb 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment