def dist_ts(ts, lab = '', bins = 40): import scipy.stats as ss # two subplots side by side f, (ax1, ax2) = plt.subplots(1, 2, figsize=(7, 3)) # histogram with labels ts.hist(ax = ax1, bins = bins, alpha = 0.5) ax1.set_xlabel('Value') ax1.set_ylabel('Frequency') ax1.set_title('Histogram of ' + lab) # plot the q-q plot on the other axes ss.probplot(ts, plot = ax2) dist_ts(white, 'white noise')