kramer65
February 8th, 2012, 03:03 PM
Hello,
I am creating a plot in Python using matplotlib and its plot_date (http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot_date) function as follows (the resulting plot is attached below):
plt.figure(1)
plt.subplot(221)
plt.plot_date(date_line, numbers1, fmt='b-', tz=None, xdate=True, ydate=False, hold=None)
plt.plot_date(date_line, numbers2, fmt='r--', tz=None, xdate=True, ydate=False, hold=None)
# this 4 times for all the plots.
plt.close(1)
As you can see in the attached image, the dates on the X-axis overlap so that you can't read any of it anymore.
Is there a way to display only what fits? So for example only the first and the last date, or when the data spans several years display only the whole years, and not every day..
All tips are welcome!
I am creating a plot in Python using matplotlib and its plot_date (http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot_date) function as follows (the resulting plot is attached below):
plt.figure(1)
plt.subplot(221)
plt.plot_date(date_line, numbers1, fmt='b-', tz=None, xdate=True, ydate=False, hold=None)
plt.plot_date(date_line, numbers2, fmt='r--', tz=None, xdate=True, ydate=False, hold=None)
# this 4 times for all the plots.
plt.close(1)
As you can see in the attached image, the dates on the X-axis overlap so that you can't read any of it anymore.
Is there a way to display only what fits? So for example only the first and the last date, or when the data spans several years display only the whole years, and not every day..
All tips are welcome!