@@ -868,6 +868,8 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
868
868
869
869
return lines
870
870
871
+ @munits ._accepts_units (convert_x = ['positions' ],
872
+ convert_y = ['lineoffsets' , 'linelengths' ])
871
873
@_preprocess_data (replace_names = ["positions" , "lineoffsets" ,
872
874
"linelengths" , "linewidths" ,
873
875
"colors" , "linestyles" ],
@@ -956,15 +958,6 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
956
958
957
959
.. plot:: gallery/lines_bars_and_markers/eventplot_demo.py
958
960
"""
959
- self ._process_unit_info (xdata = positions ,
960
- ydata = [lineoffsets , linelengths ],
961
- kwargs = kwargs )
962
-
963
- # We do the conversion first since not all unitized data is uniform
964
- positions = self .convert_xunits (positions )
965
- lineoffsets = self .convert_yunits (lineoffsets )
966
- linelengths = self .convert_yunits (linelengths )
967
-
968
961
if not iterable (positions ):
969
962
positions = [positions ]
970
963
elif any (iterable (position ) for position in positions ):
@@ -4694,6 +4687,7 @@ def fill(self, *args, **kwargs):
4694
4687
self .autoscale_view ()
4695
4688
return patches
4696
4689
4690
+ @munits ._accepts_units (convert_x = ['x' ], convert_y = ['y1' , 'y2' ])
4697
4691
@_preprocess_data (replace_names = ["x" , "y1" , "y2" , "where" ],
4698
4692
label_namer = None )
4699
4693
@docstring .dedent_interpd
@@ -4787,14 +4781,10 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
4787
4781
kwargs ['facecolor' ] = \
4788
4782
self ._get_patches_for_fill .get_next_color ()
4789
4783
4790
- # Handle united data, such as dates
4791
- self ._process_unit_info (xdata = x , ydata = y1 , kwargs = kwargs )
4792
- self ._process_unit_info (ydata = y2 )
4793
-
4794
4784
# Convert the arrays so we can work with them
4795
- x = ma .masked_invalid (self . convert_xunits ( x ) )
4796
- y1 = ma .masked_invalid (self . convert_yunits ( y1 ) )
4797
- y2 = ma .masked_invalid (self . convert_yunits ( y2 ) )
4785
+ x = ma .masked_invalid (x )
4786
+ y1 = ma .masked_invalid (y1 )
4787
+ y2 = ma .masked_invalid (y2 )
4798
4788
4799
4789
for name , array in [('x' , x ), ('y1' , y1 ), ('y2' , y2 )]:
4800
4790
if array .ndim > 1 :
@@ -4877,6 +4867,7 @@ def get_interp_point(ind):
4877
4867
self .autoscale_view ()
4878
4868
return collection
4879
4869
4870
+ @munits ._accepts_units (convert_x = ['x1' , 'x2' ], convert_y = ['y' ])
4880
4871
@_preprocess_data (replace_names = ["y" , "x1" , "x2" , "where" ],
4881
4872
label_namer = None )
4882
4873
@docstring .dedent_interpd
@@ -4970,14 +4961,10 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
4970
4961
kwargs ['facecolor' ] = \
4971
4962
self ._get_patches_for_fill .get_next_color ()
4972
4963
4973
- # Handle united data, such as dates
4974
- self ._process_unit_info (ydata = y , xdata = x1 , kwargs = kwargs )
4975
- self ._process_unit_info (xdata = x2 )
4976
-
4977
4964
# Convert the arrays so we can work with them
4978
- y = ma .masked_invalid (self . convert_yunits ( y ) )
4979
- x1 = ma .masked_invalid (self . convert_xunits ( x1 ) )
4980
- x2 = ma .masked_invalid (self . convert_xunits ( x2 ) )
4965
+ y = ma .masked_invalid (y )
4966
+ x1 = ma .masked_invalid (x1 )
4967
+ x2 = ma .masked_invalid (x2 )
4981
4968
4982
4969
for name , array in [('y' , y ), ('x1' , x1 ), ('x2' , x2 )]:
4983
4970
if array .ndim > 1 :
0 commit comments