-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Labels
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: date handling
Description
The January in this plot doesn't get labeled as 2021 in this plot:
using
AutoDateLocator(minticks=20, maxticks=30)
you get
There are no
zeroes
helping at the year mark here (actually the zero are month because of the wrong level), which makes >for a pretty fun read of this plot.
People wonder: is it 2020-2021 or 2021-2022 ? Why is thereJun
in the bottom right?
Originally posted by @leolchat in #17269 (comment)
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['date.converter'] = 'concise'
import matplotlib.dates as mdates
locator = mdates.AutoDateLocator(minticks=20, maxticks=30)
dates = [np.datetime64( '2020-06-06 18:08:30'), np.datetime64('2021-06-06 18:08:31')]
fig, ax = plt.subplots()
ax.plot(dates, [0, 1])
ax.set_xlim(np.datetime64( '2020-06-06 18:08:30.3'), np.datetime64( '2021-06-06 18:08:30.5'))
ax.xaxis.set_major_locator(locator)
plt.show()
Metadata
Metadata
Assignees
Labels
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Actiontopic: date handling