@@ -638,6 +638,7 @@ def mountain_plot(
638638 fc = 0.3 * c + (1 - 0.3 ) * np .array ([1 , 1 , 1 ]) # convert rgb+alpha to rgb
639639 norm = np .max (np .abs (NbyX )) if norm_by == "max" else norm_by
640640 global_shift = kwargs .get ("global_shift" , 0 ) #any additional shift to add to each of the lines
641+ shade_skiprate = kwargs .get ("shade_skiprate" , 1 ) # skip rate for plotting shading (1 for every points, etc.)
641642 if norm <= 1e-6 : norm = 100 #large
642643 NbyX = overlap * NbyX / norm
643644 if fig is None and ax is None :
@@ -654,11 +655,12 @@ def mountain_plot(
654655
655656 zorder = 1
656657 X_ = X .copy ()
658+ mask = np .arange (len (X_ ))[::shade_skiprate ]
657659 if nan_bins is not None : X_ [nan_bins ] = np .nan
658660 for i in range (len (NbyX )):
659661 ax .plot (X_ , NbyX [i ] + i + 1 + global_shift , c = c , zorder = zorder , lw = linewidth )
660662 zorder -= 0.01
661- ax .fill_between (X_ , NbyX [i ] + i + 1 + global_shift , i + 1 + global_shift , color = fc , zorder = zorder , alpha = 0.8 , linewidth = 0 , ** shade_kwargs )
663+ ax .fill_between (X_ [ mask ] , NbyX [i ][ mask ] + i + 1 + global_shift , i + 1 + global_shift , color = fc , zorder = zorder , alpha = 0.8 , linewidth = 0 , ** shade_kwargs )
662664 zorder -= 0.01
663665 ax .spines ["left" ].set_bounds (1 , len (NbyX ))
664666 ax .spines ["bottom" ].set_position (("outward" , 1 ))
0 commit comments