Skip to content

Commit

Permalink
Remove deprecated plot_date calls (pandas-dev#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>
  • Loading branch information
QuLogic and pre-commit-ci[bot] authored Apr 30, 2024
1 parent 53b7f24 commit c9bc480
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 @@ -1432,13 +1432,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 c9bc480

Please sign in to comment.