Note that X-axis draws log scale graph in python
import pylab as pl
import numpy as np
data1 = (np.random.normal(size=100) + 10)* 1e-5
data2 = (np.random.normal(size=100) + 10)* 1e-10
data = np.r_[data1, data2]
#Histogram creation
print(data)
pl.hist(data)
pl.hist(data)
pl.gca().set_xscale("log")
The width of each bar (also called bins) is not logarithmic, I see.
#Histogram creation
print(data)
pl.hist(data, bins=np.logspace(-11, -3, 500))
pl.gca().set_xscale("log")
I got it. The option of np.logspace is like "Create 500 bins in the range of 10 ^ -11 to 10 ^ 3".
Recommended Posts