I'd like to put this name on the x-axis of 2018 2019 2020 2021 2022 and show it as a plot. How do I type the code to keep the 20180, 5 and 2019 values from coming up?
import matplotlib.pyplot as plt
from matplotlib import dates
plt.figure()
ax = plt.gca()
ax.xaxis.set_major_locator(dates.YearLocator())
You can add it.
© 2024 OneMinuteCode. All rights reserved.