Skip to content

Commit

Permalink
Maintain data=None in plot()'s explicit signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Jun 7, 2018
1 parent f88f6e8 commit 6758c71
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
# Uses a custom implementation of data-kwarg handling in
# _process_plot_var_args.
@docstring.dedent_interpd
def plot(self, *args, scalex=True, scaley=True, **kwargs):
def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
"""
Plot y versus x as lines and/or markers.
Expand Down Expand Up @@ -1304,7 +1304,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
"""
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
lines = [*self._get_lines(*args, **kwargs)]
lines = [*self._get_lines(*args, data=data, **kwargs)]
for line in lines:
self.add_line(line)
self.autoscale_view(scalex=scalex, scaley=scaley)
Expand Down Expand Up @@ -1690,7 +1690,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
#### Specialized plotting

# @_preprocess_data() # let 'plot' do the unpacking..
def step(self, x, y, *args, where='pre', **kwargs):
def step(self, x, y, *args, where='pre', data=None, **kwargs):
"""
Make a step plot.
Expand Down Expand Up @@ -1756,7 +1756,7 @@ def step(self, x, y, *args, where='pre', **kwargs):
"'pre', 'post' or 'mid'")
kwargs['linestyle'] = 'steps-' + where + kwargs.get('linestyle', '')

return self.plot(x, y, *args, **kwargs)
return self.plot(x, y, *args, data=data, **kwargs)

@_preprocess_data()
@docstring.dedent_interpd
Expand Down Expand Up @@ -4533,7 +4533,7 @@ def barbs(self, *args, **kw):

# Uses a custom implementation of data-kwarg handling in
# _process_plot_var_args.
def fill(self, *args, **kwargs):
def fill(self, *args, data=None, **kwargs):
"""
Plot filled polygons.
Expand All @@ -4556,6 +4556,10 @@ def fill(self, *args, **kwargs):
ax.fill(x, y, x2, y2) # two polygons
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
data : indexable object, optional
An object with labelled data. If given, provide the label names to
plot in *x* and *y*.
Returns
-------
a list of :class:`~matplotlib.patches.Polygon`
Expand All @@ -4573,7 +4577,7 @@ def fill(self, *args, **kwargs):
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)

patches = []
for poly in self._get_patches_for_fill(*args, **kwargs):
for poly in self._get_patches_for_fill(*args, data=data, **kwargs):
self.add_patch(poly)
patches.append(poly)
self.autoscale_view()
Expand Down

0 comments on commit 6758c71

Please sign in to comment.