def set_date_axis(ax=None, dateformat='%d.%m.'):
"""Set DateFormatter for given AxesSubplot.
Parameters:
ax (AxesSubplot): Matplotlib axes.
dateformat (str): Format string for date labels on xaxis.
"""
if ax is None:
ax = plt.gca()
formatter = dates.DateFormatter(dateformat)
ax.xaxis.set_major_formatter(formatter)
ax.grid('on', which='both', linestyle='-')
评论列表
文章目录