Skip to content

Commit 3badad1

Browse files
committed
MAINT: replace ambiguous space in plotting docstring
1 parent 4e26644 commit 3badad1

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ def _make_plot(self, fig: Figure) -> None:
15591559
rendered with a single LineCollection for a large speed-up while keeping
15601560
public behaviour identical to the original per-column path.
15611561
"""
1562-
# choose once whether to use the LineCollection fast path
1562+
# decide once whether we can use the LineCollection fast draw
15631563
threshold = 200
15641564
use_collection = (
15651565
not self._is_ts_plot()
@@ -1568,9 +1568,10 @@ def _make_plot(self, fig: Figure) -> None:
15681568
and len(self.data.columns) > threshold
15691569
)
15701570

1571+
# choose ts-plot helper vs. regular helper
15711572
if self._is_ts_plot():
15721573
data = maybe_convert_index(self._get_ax(0), self.data)
1573-
x = data.index # dummy (ignored by _ts_plot)
1574+
x = data.index # dummy; _ts_plot ignores it
15741575
plotf = self._ts_plot
15751576
it = data.items()
15761577
else:
@@ -1592,19 +1593,22 @@ def _make_plot(self, fig: Figure) -> None:
15921593
if self.color is not None:
15931594
kwds["color"] = self.color
15941595

1595-
style, kwds = self._apply_style_colors( # type: ignore[arg-type]
1596-
colors, kwds, i, label
1596+
style, kwds = self._apply_style_colors(
1597+
colors,
1598+
kwds,
1599+
i,
1600+
label, # type: ignore[arg-type]
15971601
)
15981602
kwds.update(self._get_errorbars(label=label, index=i))
15991603

16001604
label_str = self._mark_right_label(pprint_thing(label), index=i)
16011605
kwds["label"] = label_str
16021606

16031607
if use_collection:
1604-
# collect vertices for the final LineCollection
1608+
# collect vertices; defer drawing
16051609
segments.append(np.column_stack((x, y)))
16061610

1607-
# keep legend parity with a tiny proxy only if legend is on
1611+
# tiny proxy only if legend is requested
16081612
if self.legend:
16091613
proxy = mpl.lines.Line2D(
16101614
[],
@@ -1614,7 +1618,7 @@ def _make_plot(self, fig: Figure) -> None:
16141618
"linewidth", mpl.rcParams["lines.linewidth"]
16151619
),
16161620
linestyle=kwds.get("linestyle", "-"),
1617-
marker=kwds.get("marker", None),
1621+
marker=kwds.get("marker"),
16181622
)
16191623
self._append_legend_handles_labels(proxy, label_str)
16201624
else:
@@ -1630,19 +1634,21 @@ def _make_plot(self, fig: Figure) -> None:
16301634
)
16311635
self._append_legend_handles_labels(newlines[0], label_str)
16321636

1633-
# reset x-limits for true time-series plots
1637+
# reset x-limits for true ts plots
16341638
if self._is_ts_plot():
16351639
lines = get_all_lines(ax)
16361640
left, right = get_xlim(lines)
16371641
ax.set_xlim(left, right)
16381642

1643+
# single draw call for fast path
16391644
if use_collection and segments:
16401645
if self.legend:
16411646
lc_colors = [
1642-
cast(mpl.lines.Line2D, h).get_color() for h in self.legend_handles
1647+
cast(mpl.lines.Line2D, h).get_color() # mypy: h is Line2D
1648+
for h in self.legend_handles
16431649
]
16441650
else:
1645-
# no legend - just follow the default colour cycle
1651+
# no legend - repeat default colour cycle
16461652
base = mpl.rcParams["axes.prop_cycle"].by_key()["color"]
16471653
lc_colors = list(itertools.islice(itertools.cycle(base), len(segments)))
16481654

0 commit comments

Comments
 (0)