def histlog10(x, **kwargs): import pylab as plt I = (x > 0) L = np.log10(x[I]) plt.clf() plt.hist(L, **kwargs)