Skip to content

Commit 9df54cc

Browse files
committed
Maintain data=None in plot()'s explicit signature.
1 parent 411551c commit 9df54cc

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
10791079
# Uses a custom implementation of data-kwarg handling in
10801080
# _process_plot_var_args.
10811081
@docstring.dedent_interpd
1082-
def plot(self, *args, scalex=True, scaley=True, **kwargs):
1082+
def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
10831083
"""
10841084
Plot y versus x as lines and/or markers.
10851085
@@ -1304,7 +1304,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
13041304
13051305
"""
13061306
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
1307-
lines = [*self._get_lines(*args, **kwargs)]
1307+
lines = [*self._get_lines(*args, data=data, **kwargs)]
13081308
for line in lines:
13091309
self.add_line(line)
13101310
self.autoscale_view(scalex=scalex, scaley=scaley)
@@ -1690,7 +1690,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
16901690
#### Specialized plotting
16911691

16921692
# @_preprocess_data() # let 'plot' do the unpacking..
1693-
def step(self, x, y, *args, where='pre', **kwargs):
1693+
def step(self, x, y, *args, where='pre', data=None, **kwargs):
16941694
"""
16951695
Make a step plot.
16961696
@@ -1756,7 +1756,7 @@ def step(self, x, y, *args, where='pre', **kwargs):
17561756
"'pre', 'post' or 'mid'")
17571757
kwargs['linestyle'] = 'steps-' + where + kwargs.get('linestyle', '')
17581758

1759-
return self.plot(x, y, *args, **kwargs)
1759+
return self.plot(x, y, *args, data=data, **kwargs)
17601760

17611761
@_preprocess_data()
17621762
@docstring.dedent_interpd
@@ -4529,7 +4529,7 @@ def barbs(self, *args, **kw):
45294529

45304530
# Uses a custom implementation of data-kwarg handling in
45314531
# _process_plot_var_args.
4532-
def fill(self, *args, **kwargs):
4532+
def fill(self, *args, data=None, **kwargs):
45334533
"""
45344534
Plot filled polygons.
45354535
@@ -4552,6 +4552,10 @@ def fill(self, *args, **kwargs):
45524552
ax.fill(x, y, x2, y2) # two polygons
45534553
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
45544554
4555+
data : indexable object, optional
4556+
An object with labelled data. If given, provide the label names to
4557+
plot in *x* and *y*.
4558+
45554559
Returns
45564560
-------
45574561
a list of :class:`~matplotlib.patches.Polygon`
@@ -4569,7 +4573,7 @@ def fill(self, *args, **kwargs):
45694573
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
45704574

45714575
patches = []
4572-
for poly in self._get_patches_for_fill(*args, **kwargs):
4576+
for poly in self._get_patches_for_fill(*args, data=data, **kwargs):
45734577
self.add_patch(poly)
45744578
patches.append(poly)
45754579
self.autoscale_view()

0 commit comments

Comments
 (0)