@@ -304,10 +304,8 @@ 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' : 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 ))},
307
+ 'Validator' : _fill_between_validator },
308
+
311
309
'tight_layout' : { 'Default' : False ,
312
310
'Description' : 'True|False implement tight layout (minimal padding around Figure)' +
313
311
' (see also `scale_padding` kwarg)' ,
@@ -705,30 +703,24 @@ def plot( data, **kwargs ):
705
703
# fill_between is NOT supported for external_axes_mode
706
704
# (caller can easily call ax.fill_between() themselves).
707
705
if config ['fill_between' ] is not None and not external_axes_mode :
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 )
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' ]
728
720
fb ['x' ] = xdates
729
721
ax = panels .at [panid ,'axes' ][0 ]
730
722
ax .fill_between (** fb )
731
-
723
+
732
724
# put the primary axis on one side,
733
725
# and the twinx() on the "other" side:
734
726
if not external_axes_mode :
0 commit comments