eduzrh commited on
Commit
a4a865e
·
verified ·
1 Parent(s): 4b49b56

sync code

Browse files
Files changed (1) hide show
  1. code/pimamba/interpret.py +5 -3
code/pimamba/interpret.py CHANGED
@@ -207,10 +207,12 @@ def fig_memory(traces: Dict[str, pd.DataFrame], fname="fig_interpret_memory.png"
207
  ax.axis("off")
208
  continue
209
  v = df[col].to_numpy(dtype=float)
 
210
  # plot the raw quantity (each panel has its own units); the title states
211
- # early -> late means so the reader can judge the actual magnitude.
212
- ax.plot(df.strain, v, lw=1.2, color="C0")
213
- ax.set_title(f"{title}\n{v[2:8].mean():.4g} → {v[-8:].mean():.4g}",
 
214
  fontsize=7.5)
215
  ax.axvline(0.02, color="0.6", ls=":", lw=0.8)
216
  ax.grid(alpha=0.2)
 
207
  ax.axis("off")
208
  continue
209
  v = df[col].to_numpy(dtype=float)
210
+ eps = df["strain"].to_numpy(dtype=float)
211
  # plot the raw quantity (each panel has its own units); the title states
212
+ # the elastic (eps<0.02) -> plastic (eps>0.15) means, the same windows
213
+ # used in the text, so figure and table never disagree.
214
+ ax.plot(eps, v, lw=1.2, color="C0")
215
+ ax.set_title(f"{title}\n{v[eps < 0.02].mean():.4g} → {v[eps > 0.15].mean():.4g}",
216
  fontsize=7.5)
217
  ax.axvline(0.02, color="0.6", ls=":", lw=0.8)
218
  ax.grid(alpha=0.2)