diff --git a/ratinabox/Environment.py b/ratinabox/Environment.py index 0671aef8..e45122db 100644 --- a/ratinabox/Environment.py +++ b/ratinabox/Environment.py @@ -410,6 +410,8 @@ def plot_environment(self, Returns: fig, ax: the environment figures, can be used for further downstream plotting. """ + wall_lw = kwargs.get("wall_lw", 4.0) # wall linewidth for 2D environment + if self.dimensionality == "1D": extent = self.extent if fig is None and ax is None: @@ -509,7 +511,7 @@ def plot_environment(self, [wall[0][0], wall[1][0]], [wall[0][1], wall[1][1]], color=ratinabox.GREY, - linewidth=4.0, + linewidth=wall_lw, solid_capstyle="round", zorder=2, ) diff --git a/ratinabox/utils.py b/ratinabox/utils.py index 650bcf71..96e4519a 100644 --- a/ratinabox/utils.py +++ b/ratinabox/utils.py @@ -638,6 +638,7 @@ def mountain_plot( fc = 0.3 * c + (1 - 0.3) * np.array([1, 1, 1]) # convert rgb+alpha to rgb norm = np.max(np.abs(NbyX)) if norm_by == "max" else norm_by global_shift = kwargs.get("global_shift", 0) #any additional shift to add to each of the lines + shade_skiprate = kwargs.get("shade_skiprate", 1) # skip rate for plotting shading (1 for every points, etc.) if norm <= 1e-6: norm=100 #large NbyX = overlap * NbyX / norm if fig is None and ax is None: @@ -654,11 +655,12 @@ def mountain_plot( zorder = 1 X_ = X.copy() + mask = np.arange(len(X_))[::shade_skiprate] if nan_bins is not None: X_[nan_bins] = np.nan for i in range(len(NbyX)): ax.plot(X_, NbyX[i] + i + 1 + global_shift, c=c, zorder=zorder, lw=linewidth) zorder -= 0.01 - 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) + 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) zorder -= 0.01 ax.spines["left"].set_bounds(1, len(NbyX)) ax.spines["bottom"].set_position(("outward", 1))