2017-02-13 64 views

回答

3

好吧,似乎有可能有對數尺度。但是,而不是使用圖表API,我應該使用繪圖API:

import numpy as np 
from bokeh.plotting import figure, show, output_notebook 

output_notebook() 

# generate random data from a powerlaw 
measured = 1/np.random.power(2.5, 100000) 

hist, edges = np.histogram(measured, bins=50) 

p = figure(title="Power law (a=2.5)", x_axis_type="log", y_axis_type='log') 
p.quad(top=hist, bottom=0, left=edges[:-1], right=edges[1:], line_color=None) 

show(p) 

enter image description here

感謝bigreddot從另一個問題的幫助!