-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement geom_function(). #3982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement geom_function(). #3982
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look good! It might be worth trying the PR on faceted plots just to make sure, but I can't see any red flags.
With facets. Works as expected. library(tidyverse)
data <- tibble(
x = 1:50,
y = x*x - 2*x + 5 + 200*rnorm(50),
a = sample(letters[1:3], 50, replace = TRUE)
)
ggplot(data, aes(x, y, color = a)) +
geom_point() +
geom_function(color = "black", fun = ~.x*.x - 2*.x + 5) +
facet_wrap(~a) ggplot(data, aes(x, y, color = a)) +
geom_point() +
geom_function(fun = ~.x*.x - 2*.x + 5) +
facet_wrap(~a) Created on 2020-05-01 by the reprex package (v0.3.0) |
@hadley I'd prefer to rewrite the documentation so it refers primarily to |
That make sense to me. I don't think changing the name of the .Rd file should cause any problems. |
Merge branch 'master' into issue-3611-geom_function # Conflicts: # NEWS.md
A first stab at implementing a
geom_function()
. Closes #3611.Open questions:
stat_function()
? Can it remain mostly as is, or should it now recommendgeom_function()
overstat_function()
?Created on 2020-05-01 by the reprex package (v0.3.0)