2017-05-20 12 views
1

私はpython(pycharm)でpowerlawにデータをプロットするためにpowerlaw配布パッケージを使用しています。私はプロットされたデータのグラフを表示する必要があります。グラフの図powerlaw分布グラフをPythonで表示

どうすればこの問題を解決できますか?ここでは、コードです:事前に

import powerlaw 

fit = powerlaw.Fit(data) 
print fit.power_law.alpha 
print fit.power_law.sigma 
print fit.power_law.xmin 

R, p = fit.distribution_compare('power_law','exponential') 
print R, p 
fig2 = fit.plot_pdf(color = '-b', linewidth = 2) 
fit.power_law.plot_pdf(color = '-b', ax = fig2) 

感謝

答えて

1

私はあなたがpowerlawと指数CCDF機能を比較するためのグラフを描きたいものを理解してから。 によって

もしあなたが意味「プロットされたデータのグラフを表示する」「のプロットを見るにはデータをフィット」は、単に以下を追加することができます。あなたがする必要がある

fit.exponential.plot_pdf(color = '-b', ax = fig2) 

注意matplotlib.pyplotをインポートします。

関連する問題