import matplotlib.pyplot as plt import numpy as np import matplotlib.cbook as cbook # load up some sample financial data datafile = cbook.get_sample_data('goog.npy') r = np.load(datafile).view(np.recarray) # create two subplots with the shared x and y axes fig, (ax1, ax2) = plt.subplots(1,2, sharex=True, sharey=True) pricemin = r.close.min() ax1.plot(r.date, r.close, lw=2) ax2.fill_between(r.date, pricemin, r.close, facecolor='blue', alpha=0.5) for ax in ax1, ax2: ax.grid(True) ax1.set_ylabel('price') for label in ax2.get_yticklabels(): label.set_visible(False) fig.suptitle('Google (GOOG) daily closing price') fig.autofmt_xdate()