julia の pyplot で、ヒストグラムを描くの方法

julia の pyplot では、 matplotlib.pyplot.hist() が動きません。
PyPlot.plt[:hist]() と、するのだそうです。

using PyPlot, PyCall
dist_example = rand(100)
PyPlot.plt[:hist](dist_example)
# 10個の柱で描きたいとき
PyPlot.plt[:hist](dist_example,10)

ちなみに、X軸などの方向を変えて軸目盛を表示する時は、上記に続けて、

plt[:xticks]([0,0.5,1],  rotation=30)

などとします。[ ] 内は、自分が書きたい数字だけ入れたら、自動で調節してくれます。

ちなみに、seaborn は、ほとんどそのまま動きます。

using PyPlot, PyCall
@pyimport seaborn as sns

dist_example = rand(100)

sns.distplot(dist_example, kde=false, color="b")

seaborn のヒストグラムを10本にしたい時は、bins=10 を記載です。

using PyPlot, PyCall
@pyimport seaborn as sns

dist_example = rand(100)

sns.distplot(dist_example, kde=false, color="b", bins=10)

ただし、seaborn のヒストグラムは日付は、にがてなようです。

B! LINE