Skip to content

Commit

Permalink
Remove deprecated plot_date calls (#58484)
Browse files Browse the repository at this point in the history
* Remove deprecated plot_date calls

These were deprecated in Matplotlib 3.9.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit c9bc480)
  • Loading branch information
QuLogic authored and lithomas1 committed Sep 12, 2024
1 parent 2308e7c commit 799ab49
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,13 +1451,19 @@ def test_mpl_nopandas(self):
values1 = np.arange(10.0, 11.0, 0.5)
values2 = np.arange(11.0, 12.0, 0.5)

kw = {"fmt": "-", "lw": 4}

_, ax = mpl.pyplot.subplots()
ax.plot_date([x.toordinal() for x in dates], values1, **kw)
ax.plot_date([x.toordinal() for x in dates], values2, **kw)

line1, line2 = ax.get_lines()
(
line1,
line2,
) = ax.plot(
[x.toordinal() for x in dates],
values1,
"-",
[x.toordinal() for x in dates],
values2,
"-",
linewidth=4,
)

exp = np.array([x.toordinal() for x in dates], dtype=np.float64)
tm.assert_numpy_array_equal(line1.get_xydata()[:, 0], exp)
Expand Down

0 comments on commit 799ab49

Please sign in to comment.