@@ -1332,7 +1332,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1332
1332
# Uses a custom implementation of data-kwarg handling in
1333
1333
# _process_plot_var_args.
1334
1334
@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 ):
1336
1336
"""
1337
1337
Plot y versus x as lines and/or markers.
1338
1338
@@ -1557,7 +1557,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
1557
1557
1558
1558
"""
1559
1559
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 )]
1561
1561
for line in lines :
1562
1562
self .add_line (line )
1563
1563
self .autoscale_view (scalex = scalex , scaley = scaley )
@@ -1943,7 +1943,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1943
1943
#### Specialized plotting
1944
1944
1945
1945
# @_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 ):
1947
1947
"""
1948
1948
Make a step plot.
1949
1949
@@ -2008,7 +2008,7 @@ def step(self, x, y, *args, where='pre', **kwargs):
2008
2008
raise ValueError ("'where' argument to step must be "
2009
2009
"'pre', 'post' or 'mid'" )
2010
2010
kwargs ['drawstyle' ] = 'steps-' + where
2011
- return self .plot (x , y , * args , ** kwargs )
2011
+ return self .plot (x , y , * args , data = data , ** kwargs )
2012
2012
2013
2013
@_preprocess_data ()
2014
2014
@docstring .dedent_interpd
@@ -4836,7 +4836,7 @@ def barbs(self, *args, **kw):
4836
4836
4837
4837
# Uses a custom implementation of data-kwarg handling in
4838
4838
# _process_plot_var_args.
4839
- def fill (self , * args , ** kwargs ):
4839
+ def fill (self , * args , data = None , ** kwargs ):
4840
4840
"""
4841
4841
Plot filled polygons.
4842
4842
@@ -4859,6 +4859,13 @@ def fill(self, *args, **kwargs):
4859
4859
ax.fill(x, y, x2, y2) # two polygons
4860
4860
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
4861
4861
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
+
4862
4869
Returns
4863
4870
-------
4864
4871
a list of :class:`~matplotlib.patches.Polygon`
@@ -4876,7 +4883,7 @@ def fill(self, *args, **kwargs):
4876
4883
kwargs = cbook .normalize_kwargs (kwargs , mlines .Line2D ._alias_map )
4877
4884
4878
4885
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 ):
4880
4887
self .add_patch (poly )
4881
4888
patches .append (poly )
4882
4889
self .autoscale_view ()
0 commit comments