Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6758c71

Browse files
committed
Maintain data=None in plot()'s explicit signature.
1 parent f88f6e8 commit 6758c71

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
@@ -4533,7 +4533,7 @@ def barbs(self, *args, **kw):
45334533

45344534
# Uses a custom implementation of data-kwarg handling in
45354535
# _process_plot_var_args.
4536-
def fill(self, *args, **kwargs):
4536+
def fill(self, *args, data=None, **kwargs):
45374537
"""
45384538
Plot filled polygons.
45394539
@@ -4556,6 +4556,10 @@ def fill(self, *args, **kwargs):
45564556
ax.fill(x, y, x2, y2) # two polygons
45574557
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
45584558
4559+
data : indexable object, optional
4560+
An object with labelled data. If given, provide the label names to
4561+
plot in *x* and *y*.
4562+
45594563
Returns
45604564
-------
45614565
a list of :class:`~matplotlib.patches.Polygon`
@@ -4573,7 +4577,7 @@ def fill(self, *args, **kwargs):
45734577
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
45744578

45754579
patches = []
4576-
for poly in self._get_patches_for_fill(*args, **kwargs):
4580+
for poly in self._get_patches_for_fill(*args, data=data, **kwargs):
45774581
self.add_patch(poly)
45784582
patches.append(poly)
45794583
self.autoscale_view()

0 commit comments

Comments
 (0)