Skip to content

Commit e9aa248

Browse files
committed
Maintain data=None in plot()'s explicit signature.
1 parent 2596815 commit e9aa248

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/matplotlib/axes/_axes.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
13321332
# Uses a custom implementation of data-kwarg handling in
13331333
# _process_plot_var_args.
13341334
@docstring.dedent_interpd
1335-
def plot(self, *args, scalex=True, scaley=True, **kwargs):
1335+
def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
13361336
"""
13371337
Plot y versus x as lines and/or markers.
13381338
@@ -1557,7 +1557,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
15571557
15581558
"""
15591559
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
1560-
lines = [*self._get_lines(*args, **kwargs)]
1560+
lines = [*self._get_lines(*args, data=data, **kwargs)]
15611561
for line in lines:
15621562
self.add_line(line)
15631563
self.autoscale_view(scalex=scalex, scaley=scaley)
@@ -1943,7 +1943,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
19431943
#### Specialized plotting
19441944

19451945
# @_preprocess_data() # let 'plot' do the unpacking..
1946-
def step(self, x, y, *args, where='pre', **kwargs):
1946+
def step(self, x, y, *args, where='pre', data=None, **kwargs):
19471947
"""
19481948
Make a step plot.
19491949
@@ -2008,7 +2008,7 @@ def step(self, x, y, *args, where='pre', **kwargs):
20082008
raise ValueError("'where' argument to step must be "
20092009
"'pre', 'post' or 'mid'")
20102010
kwargs['drawstyle'] = 'steps-' + where
2011-
return self.plot(x, y, *args, **kwargs)
2011+
return self.plot(x, y, *args, data=data, **kwargs)
20122012

20132013
@_preprocess_data()
20142014
@docstring.dedent_interpd
@@ -4836,7 +4836,7 @@ def barbs(self, *args, **kw):
48364836

48374837
# Uses a custom implementation of data-kwarg handling in
48384838
# _process_plot_var_args.
4839-
def fill(self, *args, **kwargs):
4839+
def fill(self, *args, data=None, **kwargs):
48404840
"""
48414841
Plot filled polygons.
48424842
@@ -4859,6 +4859,13 @@ def fill(self, *args, **kwargs):
48594859
ax.fill(x, y, x2, y2) # two polygons
48604860
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
48614861
4862+
data : indexable object, optional
4863+
An object with labelled data. If given, provide the label names to
4864+
plot in *x* and *y*, e.g.::
4865+
4866+
ax.fill("time", "signal",
4867+
data={"time": [0, 1, 2], "signal": [0, 1, 0]})
4868+
48624869
Returns
48634870
-------
48644871
a list of :class:`~matplotlib.patches.Polygon`
@@ -4876,7 +4883,7 @@ def fill(self, *args, **kwargs):
48764883
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
48774884

48784885
patches = []
4879-
for poly in self._get_patches_for_fill(*args, **kwargs):
4886+
for poly in self._get_patches_for_fill(*args, data=data, **kwargs):
48804887
self.add_patch(poly)
48814888
patches.append(poly)
48824889
self.autoscale_view()

0 commit comments

Comments
 (0)