Making pyplot.hist() first and last bins include outliers

前端 未结 2 2195
余生分开走
余生分开走 2021-02-12 14:30

pyplot.hist() documentation specifies that when setting a range for a histogram \"lower and upper outliers are ignored\".

Is it possible to make th

2条回答
  •  天涯浪人
    2021-02-12 14:56

    No. Looking at matplotlib.axes.Axes.hist and the direct use of numpy.histogram I'm fairly confident in saying that there is no smarter solution than using clip (other than extending the bins that you histogram with).

    I'd encourage you to look at the source of matplotlib.axes.Axes.hist (it's just Python code, though admittedly hist is slightly more complex than most of the Axes methods) - it is the best way to verify this kind of question.

    HTH

提交回复
热议问题