8000 pp.hist paremeter 'density' does not scale data appropriately · Issue #16147 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
pp.hist paremeter 'density' does not scale data appropriately #16147
Closed
@jacobnrohan

Description

@jacobnrohan

Bug report

Bug summary

'density' argument in pp.hist() does not scale data appropriately

Code for reproduction

print(matplotlib.__version__)
a = np.array([2.7871902, -0.16587533, 2.400487, -0.22041278, 3.5801802, -0.458245, 1.7463026, -0.29266447, 1.4848666,
-0.13430892, 3.2835798, -0.027157811, 0.55700374, -0.12730916, 0.3448488, -0.3222668, 0.22995274, -0.031041186,
0.1893434, -0.01208617, 2.104571, -0.009364999, 0.062176008, -0.045246653, 0.031220708,-0.04697927,0.02657558,
-0.031277005,0.01713127,-0.031898744,0.012391248,-0.008699492,0.007395051,-0.0067330534,0.005730991,-0.004206775,
0.0037450397,-0.000804145,0.0025498285,-0.0028463008,])
b = pp.hist(a, density=True)
print(b[0])
print(b[1])

Actual outcome

3.1.1
[0.43333723 1.54763297 0.06190532 0.         0.06190532 0.06190532
 0.06190532 0.06190532 0.06190532 0.12381064]
[-0.458245   -0.05440248  0.34944004  0.75328256  1.15712508  1.5609676
  1.96481012  2.36865264  2.77249516  3.17633768  3.5801802 ]

Screenshot from 2020-01-07 15-09-30

Expected outcome

all values on plot should be <1.0

Matplotlib version

  • Operating system: Debian GNU/Linux 9 (stretch) 64-bit
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.7.5 installed via anaconda3, default channels
  • Jupyter version (if applicable): n/a
  • Other libraries: n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0