Skip to content

Conversation

Bisaloo
Copy link
Contributor

@Bisaloo Bisaloo commented Apr 14, 2021

Output:

image

I believe this new example is useful because it might not be straightforward how to use the fill aesthetic with geom_function()/stat_function().

My first try was to simply add fill = "blue" but it doesn't work because the geom_line() doesn't understand fill.

#'
#' base + stat_function(fun = dnorm, geom = "point", n = 20)
#'
#' base + stat_function(fun = dnorm, geom = "density", color = "blue", fill = "blue", alpha = 0.5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why not using geom = "polygon" - it seems more general...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no specific reason. geom = "density" seemed a little bit more intuitive since the example is about plotting a probability density function. But I have no strong feelings on this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@thomasp85 thomasp85 merged commit aaaec2f into tidyverse:main Nov 9, 2021
@thomasp85
Copy link
Member

Thanks!

@Bisaloo Bisaloo deleted the fill-stat_function branch November 9, 2021 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants