Skip to content

geom_histogram + xlim causes first bar to disappear #3332

@jpritikin

Description

@jpritikin

ggplot2 3.1.1

library(ggplot2)

set.seed(1)
v <- c(rep(0,10), sample.int(250, 100, replace=TRUE), rep(250,10))
qplot(v, geom="histogram", binwidth=4)  # good

# Here we lose the first bar
qplot(v, geom="histogram", binwidth=4) + xlim(0,250)
qplot(v, geom="histogram", binwidth=4) + xlim(-1,250)

Good output

Bad output

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