menu_book Course Curriculum (Matplotlib) expand_more
Figure Basics
Axes & Labels
Styling
Layouts
Statistical Plots
Images & Geometry
Scales & Dates
Output & Interaction
Date formatter
Learn Date formatter in Matplotlib with a dedicated explanation, a topic-specific example, edge guidance, and a mastery check.
12 min read
•
Advanced
matplotlib-052.py
python
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates, datetime as dt
dates=[dt.date(2026,9,d) for d in range(1,6)]; fig,ax=plt.subplots(); ax.plot(dates,[1,2,4,3,5]); ax.xaxis.set_major_formatter(mdates.DateFormatter("%d %b")); plt.show()
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content