Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
Bug summary
When you make a plot with theConciseDateFormatter
that shows on the x axis days and months theoffset_string
also shows the month (with the year) which I think is redundant because you only need the year
Code for reproduction
importmatplotlib.pyplotaspltimportmatplotlib.datesasmdatesimportdatetimefig,ax=plt.subplots()d1=datetime.datetime(1997,1,1)d2=d1+datetime.timedelta(weeks=520)locator=mdates.AutoDateLocator()formatter=mdates.ConciseDateFormatter(locator)ax.xaxis.set_major_locator(locator)ax.xaxis.set_major_formatter(formatter)ax.plot([d1,d2], [0,0])ax.set_xlim(d1,d1+datetime.timedelta(weeks=3))ax.set_xlim(d1+datetime.timedelta(weeks=1),d1+datetime.timedelta(weeks=10))plt.show()
Actual outcome
Expected outcome
Additional information
When theConciseDateFormatter
was proposedhere you can see the same expected behavior:
Operating system
Ubuntu 22.04.1 LTS
Matplotlib Version
3.6.2
Matplotlib Backend
agg
Python version
3.10.6
Jupyter version
No response
Installation
pip