@@ -152,7 +152,7 @@ def histplot(
152152 raise ValueError ("ax must be a matplotlib Axes object" )
153153
154154 # arg check
155- _allowed_histtype = ["fill" , "step" , "errorbar" ]
155+ _allowed_histtype = ["fill" , "step" , "errorbar" , "band" ]
156156 _err_message = f"Select 'histtype' from: { _allowed_histtype } "
157157 assert histtype in _allowed_histtype , _err_message
158158 assert flow is None or flow in {
@@ -462,6 +462,23 @@ def iterable_not_string(arg):
462462 return_artists .append (StairsArtists (_f , None , None ))
463463 _artist = _f
464464
465+ elif histtype == "band" :
466+ band_defaults = {
467+ "alpha" : 0.5 ,
468+ "edgecolor" : "lightgray" ,
469+ "hatch" : "///" ,
470+ }
471+ for i in range (len (plottables )):
472+ _kwargs = _chunked_kwargs [i ]
473+ _f = ax .stairs (
474+ ** plottables [i ].to_stairband (),
475+ label = _labels [i ],
476+ fill = True ,
477+ ** soft_update_kwargs (_kwargs , band_defaults ),
478+ )
479+ return_artists .append (StairsArtists (_f , None , None ))
480+ _artist = _f
481+
465482 elif histtype == "errorbar" :
466483 err_defaults = {
467484 "linestyle" : "none" ,
@@ -480,14 +497,15 @@ def iterable_not_string(arg):
480497 _xerr = None
481498
482499 for i in range (len (plottables )):
500+ _kwargs = _chunked_kwargs [i ]
483501 _plot_info = plottables [i ].to_errorbar ()
484502 if yerr is False :
485503 _plot_info ["yerr" ] = None
486504 _plot_info ["xerr" ] = _xerr
487505 _e = ax .errorbar (
488506 ** _plot_info ,
489507 label = _labels [i ],
490- ** soft_update_kwargs (_chunked_kwargs [ i ] , err_defaults ),
508+ ** soft_update_kwargs (_kwargs , err_defaults ),
491509 )
492510 return_artists .append (ErrorBarArtists (_e ))
493511
0 commit comments