X Tutup
Skip to content

Histogram gap artifacts #4340

@fonnesbeck

Description

@fonnesbeck

I'm hoping there is a way to improve the default behavior of hist, which often generates gap artifacts between classes in histograms. For example, even using clean integer data that has natural breaks:

lsl_dr.degree_hl.dropna().value_counts()

6    10446
3     3127
4     3041
5     2705
2     1416
0      549
1      170
dtype: int64

I get a result like the following:

bad hist

This plot is misleading because it suggests there are intervening classes with zero counts in between the bars. I assume this is a solved problem, since it does not occur in other packages (e.g. ggplot).

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

      X Tutup