u++の備忘録

matplotlib.pyplot.histとseaborn.distplotの違い

seaborn.distplotの公式ドキュメントには「matplotlib.pyplot.histを使っている」と記載がある。

This function combines the matplotlib hist function (with automatic calculation of a good default bin size) with the seaborn kdeplot() and rugplot() functions.

seaborn.distplot — seaborn 0.8.1 documentation

実際にseabornのソースコードを追うと、matplotlib.pyplot.histのパラメータで“normed=True”として実行している。
github.com

matplotlib.pyplot.histのデフォルト設定は“normed=None”なので、その部分だけmatplotlib.pyplot.histとseaborn.distplotで違いが生じる。
matplotlib.pyplot.hist — Matplotlib 2.2.2 documentation