@@ -1325,7 +1325,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1325
1325
# Uses a custom implementation of data-kwarg handling in
1326
1326
# _process_plot_var_args.
1327
1327
@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 ):
1329
1329
"""
1330
1330
Plot y versus x as lines and/or markers.
1331
1331
@@ -1550,7 +1550,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
1550
1550
1551
1551
"""
1552
1552
kwargs = cbook .normalize_kwargs (kwargs , mlines .Line2D ._alias_map )
1553
- lines = [* self ._get_lines (* args , ** kwargs )]
1553
+ lines = [* self ._get_lines (* args , data = data , ** kwargs )]
1554
1554
for line in lines :
1555
1555
self .add_line (line )
1556
1556
self .autoscale_view (scalex = scalex , scaley = scaley )
@@ -1936,7 +1936,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1936
1936
#### Specialized plotting
1937
1937
1938
1938
# @_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 ):
1940
1940
"""
1941
1941
Make a step plot.
1942
1942
@@ -2002,7 +2002,7 @@ def step(self, x, y, *args, where='pre', **kwargs):
2002
2002
"'pre', 'post' or 'mid'" )
2003
2003
kwargs ['linestyle' ] = 'steps-' + where + kwargs .get ('linestyle' , '' )
2004
2004
2005
- return self .plot (x , y , * args , ** kwargs )
2005
+ return self .plot (x , y , * args , data = data , ** kwargs )
2006
2006
2007
2007
@_preprocess_data ()
2008
2008
@docstring .dedent_interpd
@@ -4816,7 +4816,7 @@ def barbs(self, *args, **kw):
4816
4816
4817
4817
# Uses a custom implementation of data-kwarg handling in
4818
4818
# _process_plot_var_args.
4819
- def fill (self , * args , ** kwargs ):
4819
+ def fill (self , * args , data = None , ** kwargs ):
4820
4820
"""
4821
4821
Plot filled polygons.
4822
4822
@@ -4839,6 +4839,13 @@ def fill(self, *args, **kwargs):
4839
4839
ax.fill(x, y, x2, y2) # two polygons
4840
4840
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
4841
4841
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
+
4842
4849
Returns
4843
4850
-------
4844
4851
a list of :class:`~matplotlib.patches.Polygon`
@@ -4856,7 +4863,7 @@ def fill(self, *args, **kwargs):
4856
4863
kwargs = cbook .normalize_kwargs (kwargs , mlines .Line2D ._alias_map )
4857
4864
4858
4865
patches = []
4859
- for poly in self ._get_patches_for_fill (* args , ** kwargs ):
4866
+ for poly in self ._get_patches_for_fill (* args , data = data , ** kwargs ):
4860
4867
self .add_patch (poly )
4861
4868
patches .append (poly )
4862
4869
self .autoscale_view ()
0 commit comments