Skip to content

geom_density() as filled area chart #199

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

Closed
cpsievert opened this issue Apr 9, 2015 · 2 comments
Closed

geom_density() as filled area chart #199

cpsievert opened this issue Apr 9, 2015 · 2 comments

Comments

@cpsievert
Copy link
Collaborator

To me, geom_density() should translate to a filled area chart. Right now it's translated to a histogram (with autobinning). As a result, most arguments to stat_density() are ignored and geom_density() + geom_histogram() doesn't seem to make sense. Consider the following:

p <- ggplot(mtcars, aes(wt)) + geom_density() + geom_histogram(aes(y = ..density..))

rplot

This actually gives me an error:

ggplotly(p)
Error in if (is.character(new.mode) && !is.na(new.mode)) { : 
  missing value where TRUE/FALSE needed

Any thoughts/objections @tdhock @chriddyp @mkcor?

@tdhock
Copy link
Contributor

tdhock commented Apr 9, 2015

seems fine with me .. are there any tests that would need to be changed?

@cpsievert
Copy link
Collaborator Author

Yea, test-ggplot-density.R would have to change.

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

No branches or pull requests

2 participants