@@ -1325,7 +1325,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
13251325# Uses a custom implementation of data-kwarg handling in
13261326# _process_plot_var_args.
13271327@docstring .dedent_interpd
1328- def plot (self ,* args ,scalex = True ,scaley = True ,** kwargs ):
1328+ def plot (self ,* args ,scalex = True ,scaley = True ,data = None , ** kwargs ):
13291329"""
13301330 Plot y versus x as lines and/or markers.
13311331
@@ -1550,7 +1550,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
15501550
15511551 """
15521552kwargs = cbook .normalize_kwargs (kwargs ,mlines .Line2D ._alias_map )
1553- lines = [* self ._get_lines (* args ,** kwargs )]
1553+ lines = [* self ._get_lines (* args ,data = data , ** kwargs )]
15541554for line in lines :
15551555self .add_line (line )
15561556self .autoscale_view (scalex = scalex ,scaley = scaley )
@@ -1936,7 +1936,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
19361936#### Specialized plotting
19371937
19381938# @_preprocess_data() # let 'plot' do the unpacking..
1939- def step (self ,x ,y ,* args ,where = 'pre' ,** kwargs ):
1939+ def step (self ,x ,y ,* args ,where = 'pre' ,data = None , ** kwargs ):
19401940"""
19411941 Make a step plot.
19421942
@@ -2002,7 +2002,7 @@ def step(self, x, y, *args, where='pre', **kwargs):
20022002"'pre', 'post' or 'mid'" )
20032003kwargs ['linestyle' ]= 'steps-' + where + kwargs .get ('linestyle' ,'' )
20042004
2005- return self .plot (x ,y ,* args ,** kwargs )
2005+ return self .plot (x ,y ,* args ,data = data , ** kwargs )
20062006
20072007@_preprocess_data ()
20082008@docstring .dedent_interpd
@@ -4816,7 +4816,7 @@ def barbs(self, *args, **kw):
48164816
48174817# Uses a custom implementation of data-kwarg handling in
48184818# _process_plot_var_args.
4819- def fill (self ,* args ,** kwargs ):
4819+ def fill (self ,* args ,data = None , ** kwargs ):
48204820"""
48214821 Plot filled polygons.
48224822
@@ -4839,6 +4839,13 @@ def fill(self, *args, **kwargs):
48394839 ax.fill(x, y, x2, y2) # two polygons
48404840 ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
48414841
4842+ data : indexable object, optional
4843+ An object with labelled data. If given, provide the label names to
4844+ plot in *x* and *y*, e.g.::
4845+
4846+ ax.fill("time", "signal",
4847+ data={"time": [0, 1, 2], "signal": [0, 1, 0]})
4848+
48424849 Returns
48434850 -------
48444851 a list of :class:`~matplotlib.patches.Polygon`
@@ -4856,7 +4863,7 @@ def fill(self, *args, **kwargs):
48564863kwargs = cbook .normalize_kwargs (kwargs ,mlines .Line2D ._alias_map )
48574864
48584865patches = []
4859- for poly in self ._get_patches_for_fill (* args ,** kwargs ):
4866+ for poly in self ._get_patches_for_fill (* args ,data = data , ** kwargs ):
48604867self .add_patch (poly )
48614868patches .append (poly )
48624869self .autoscale_view ()