Skip to content

geom_density() as filled area chart #199

Closed
@cpsievert

Description

@cpsievert

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions