Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ratinabox/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
)
Expand Down
4 changes: 3 additions & 1 deletion ratinabox/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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))
Expand Down
Loading