Skip to content

Commit

Permalink
BUG: Fix bug with example (#12786)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Aug 13, 2024
1 parent 01a1c1e commit c9f8ee2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tutorials/stats-sensor-space/70_cluster_rmANOVA_time_freq.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,16 @@ def stat_fun(*args):
n_permutations=n_permutations,
buffer_size=None,
out_type="mask",
seed=0,
)

# %%
# Create new stats image with only significant clusters:

good_clusters = np.where(cluster_p_values < 0.05)[0]
F_obs_plot = F_obs.copy()
F_obs_plot[~clusters[np.squeeze(good_clusters)]] = np.nan
F_obs_plot = np.full_like(F_obs, np.nan)
for ii in good_clusters:
F_obs_plot[clusters[ii]] = F_obs[clusters[ii]]

fig, ax = plt.subplots(figsize=(6, 4), layout="constrained")
for f_image, cmap in zip([F_obs, F_obs_plot], ["gray", "autumn"]):
Expand Down

0 comments on commit c9f8ee2

Please sign in to comment.