Skip to content

Commit 1a6f47b

Browse files
committed
TYP: silence mypy warnings in unified _make_plot
1 parent 08c0fa9 commit 1a6f47b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,10 @@ def _make_plot(self, fig: Figure) -> None:
16361636

16371637
if use_collection and segments:
16381638
if self.legend:
1639-
lc_colors = [h.get_color() for h in self.legend_handles]
1639+
lc_colors = [
1640+
cast(mpl.lines.Line2D, h).get_color() # type: ignore[attr-defined]
1641+
for h in self.legend_handles
1642+
]
16401643
else:
16411644
# no legend - just follow the default colour cycle
16421645
base = mpl.rcParams["axes.prop_cycle"].by_key()["color"]

0 commit comments

Comments
 (0)