Free tools Windows power users keep installed
One-click scans. No signup required.
In current Matplotlib, use plot instead of plot_date for date-based scatter charts and time series. Pass datetime.datetime or numpy.datetime64 values directly; Matplotlib converts them and selects date-aware ticks automatically. For points without connecting lines, set linestyle='none'; for multiple series, plot each series against the same dates and give it a label.
Why plot_date examples no longer work
Matplotlib discouraged plot_date starting in version 3.5, deprecated it in 3.9, and removed it in 3.11. For current code, replace ax.plot_date(dates, values, ...) with ax.plot(dates, values, ...), keeping any marker and line styling as explicit keyword arguments. The Matplotlib 3.11 migration notes say that “datetime-like data should directly be plotted using plot.” See the Matplotlib 3.11 API changes and the 3.9 deprecation notes.
As an Amazon Associate I earn from qualifying purchases.
Make a scatter chart with dates
Use plot with a marker and no line. This example uses NumPy dates; sequences of datetime.datetime values work as well.
import matplotlib.pyplot as plt
import numpy as np
dates = np.array(
['2025-01-01', '2025-02-01', '2025-03-01'],
dtype='datetime64[D]'
)
values = [4, 7, 5]
fig, ax = plt.subplots()
ax.plot(dates, values, marker='o', linestyle='none', label='Observations')
ax.set_xlabel('Date')
ax.set_ylabel('Value')
ax.legend()
plt.show()
The marker sets the point symbol, while linestyle='none' prevents Matplotlib from drawing connecting segments. The public plot API supports these styling options and date-valued data.
#1 Best Overall
Plot multiple lines against the same dates
Call plot once per series, reusing the date array. Choose a distinct label for each line so the legend identifies it.
fig, ax = plt.subplots()
ax.plot(dates, series_a, marker='o', label='Series A')
ax.plot(dates, series_b, marker='s', label='Series B')
ax.set_xlabel('Date')
ax.set_ylabel('Value')
ax.legend()
plt.show()
Each y series must correspond to the dates it is plotted against. You can also provide multiple x/y pairs in a single plot call; repeated calls are often easier to read when each series needs its own label or styling. See the plot function documentation.
Rank #2
How date conversion and tick labels work
For datetime.datetime and numpy.datetime64 inputs, Matplotlib’s date unit converter handles the conversion and supplies date-aware tick locators and formatters. The defaults are AutoDateLocator and AutoDateFormatter, so start with automatic ticks before adding manual formatting. The matplotlib.dates documentation describes the available date tools.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
When to use axis_date
For ordinary datetime-like inputs, you normally do not need to call axis_date. Use ax.xaxis.axis_date (or ax.yaxis.axis_date) when numeric values should be interpreted as date coordinates, or when configuring a timezone for that axis. Set this up before plotting. Numeric coordinates must use Matplotlib’s date-day representation; they are not ordinary date strings or Unix timestamps by default. The dates and units guide explains the conversion behavior.
Rank #3
When to set locators and formatters
If the automatic tick spacing or labels do not fit the chart, use date locators such as MonthLocator or YearLocator, and formatters such as DateFormatter. ConciseDateFormatter can reduce repeated date components and may make rotated labels unnecessary. You can set axis limits with datetime-like values; if you set numeric limits, use Matplotlib date-day coordinates. The date tick labels example shows locator and formatter usage.
Date precision: when the epoch matters
Matplotlib represents dates internally as floating-point days from the default epoch, 1970-01-01 UTC. Its documentation says microsecond accuracy is achievable for dates approximately 70 years on either side of that epoch, with precision decreasing farther away. For sub-microsecond resolution, the documentation recommends floating-point seconds rather than datetime-like values. If you need to retain datetime-like values at microsecond precision for dates far from the default epoch, set a closer epoch before converting any dates. Details are in the date API documentation.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →




