I have an excel sheet of retail gas prices from years 1990 to 2019. I successfully plotted a graph of their prices against the date(years). The x-axis was created on its own and its scaled to jump every 4 years. The Date is a datetime type and the Gas price is a float. my plot was created by writing:
date = dataset['Date']
price = dataset['U.S. All Grades All Formulations Retail Gasoline Prices (Dollars per Gallon)']
plt.plot_date(date, price, linestyle='solid')
plt.xlabel("Date")
plt.ylabel("Gaslone Price / Dollar Per Gallon")
plt.tight_layout()
Now I would to "zoom" into the picture and create another graph but I would like that part where there is a steep decline from around years 2007 to 2009.
I tried using plt.xlim but I'm not sure how to input my limits.
Thank you.

plt.xlim(2007,2009)?datetime.datetimeornumpy.datetime64objects. I.e.ax.set_xlim(np.datetime64(‘2007-01-01’), np.datetime64(‘2009-12-31’))