@@ -304,8 +304,10 @@ def _valid_plot_kwargs():
304
304
'Description' : 'fill between specification as y-value, or sequence of' +
305
305
' y-values, or dict containing key "y1" plus any additional' +
306
306
' kwargs for `fill_between()`' ,
307
- 'Validator' : _fill_between_validator },
308
-
307
+ 'Validator' : lambda value : _num_or_seq_of_num (value ) or
308
+ (isinstance (value ,dict ) and 'y1' in value and
309
+ _num_or_seq_of_num (value ['y1' ])) or
310
+ isinstance (value ,(list ,tuple ))},
309
311
'tight_layout' : { 'Default' : False ,
310
312
'Description' : 'True|False implement tight layout (minimal padding around Figure)' +
311
313
' (see also `scale_padding` kwarg)' ,
@@ -703,24 +705,30 @@ def plot( data, **kwargs ):
703
705
# fill_between is NOT supported for external_axes_mode
704
706
# (caller can easily call ax.fill_between() themselves).
705
707
if config ['fill_between' ] is not None and not external_axes_mode :
706
- fblist = config ['fill_between' ]
707
- panid = config ['main_panel' ]
708
- if _num_or_seq_of_num (fblist ):
709
- fblist = [dict (y1 = fblist ),]
710
- elif isinstance (fblist ,dict ):
711
- fblist = [fblist ,]
712
- if not _list_of_dict (fblist ):
713
- raise TypeError ('Bad type for `fill_between` specifier.' )
714
- for fb in fblist :
715
- if 'x' in fb :
716
- raise ValueError ('fill_between dict may not contain `x`' )
717
- if 'panel' in fb :
718
- panid = fb ['panel' ]
719
- del fb ['panel' ]
708
+ fb = config ['fill_between' ]
709
+ panid = config ['main_panel' ]
710
+ if isinstance (fb ,list ):
711
+ for element in fb :
712
+ if 'panel' in element :
713
+ panind = element ['panel' ]
714
+ del element ['panel' ]
715
+
716
+ element ['x' ] = xdates
717
+ ax = panels .at [panid ,'axes' ][0 ]
718
+ ax .fill_between (** element )
719
+ else :
720
+ if isinstance (fb ,dict ):
721
+ if 'x' in fb :
722
+ raise ValueError ('fill_between dict may not contain `x`' )
723
+ if 'panel' in fb :
724
+ panid = fb ['panel' ]
725
+ del fb ['panel' ]
726
+ else :
727
+ fb = dict (y1 = fb )
720
728
fb ['x' ] = xdates
721
729
ax = panels .at [panid ,'axes' ][0 ]
722
730
ax .fill_between (** fb )
723
-
731
+
724
732
# put the primary axis on one side,
725
733
# and the twinx() on the "other" side:
726
734
if not external_axes_mode :
0 commit comments