fig, (ax1, ax2) = plt.subplots(figsize=(12,4), nrows=2, sharex=True)
ts = pandas.TimeSeries(data=x, index=timestamps)
tsmean = pandas.expanding_mean(ts, min_periods=5)
diff = mean.diff()
diffmean = pandas.expanding_mean(diff, min_periods=5)
ax = ts.plot(ax=ax1, label='Measurements')
tsmean.plot(ax=ax1, label='Expanding Mean')
ax1.set_yscale('log')
ax1.set_ylabel('Flow velocity (m/s)')
ax1.xaxis.tick_top()
diff.plot(ax=ax2)
diffmean.plot(ax=ax2)
ax2.set_ylabel('Diff of mean velocity')
ax1.legend(ncol=2, loc='lower right')
seaborn.despine(ax=ax1, bottom=True, top=False)
seaborn.despine(ax=ax2, bottom=False, top=True)