Skip to content

Commit

Permalink
fix colorbar suppression when vlim is joint (mne-tools#11867)
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock authored Aug 7, 2023
1 parent 86dd11d commit 7c4e27c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions mne/viz/topomap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2730,7 +2730,8 @@ def plot_psds_topomap(
if dB and not normalize:
band_data = [10 * np.log10(_d) for _d in band_data]
# handle vmin/vmax
if vlim == "joint":
joint_vlim = vlim == "joint"
if joint_vlim:
vlim = (np.array(band_data).min(), np.array(band_data).max())
# unit label
if unit is None:
Expand All @@ -2754,7 +2755,7 @@ def plot_psds_topomap(
for ax, _mask, _data, (title, (fmin, fmax)) in zip(
axes, freq_masks, band_data, bands.items()
):
colorbar = vlim != "joint" or ax == axes[-1]
colorbar = (not joint_vlim) or ax == axes[-1]
_plot_topomap_multi_cbar(
_data,
pos,
Expand Down
11 changes: 5 additions & 6 deletions tutorials/epochs/20_visualize_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@
epochs.apply_proj()

# %%
# Just as we saw in the :ref:`tut-section-raw-plot-proj` section, we can plot
# the projectors present in an `~mne.Epochs` object using the same
# `~mne.Epochs.plot_projs_topomap` method. Since the original three
# empty-room magnetometer projectors were inherited from the
# `~mne.io.Raw` file, and we added two ECG projectors for each sensor
# type, we should see nine projector topomaps:
# Just as we saw in the :ref:`tut-section-raw-plot-proj` section, we can plot the
# projectors present in an `~mne.Epochs` object using the same
# `~mne.Epochs.plot_projs_topomap` method. Since the original three empty-room
# magnetometer projectors were inherited from the `~mne.io.Raw` file, and we added two
# ECG projectors for each sensor type, we should see nine projector topomaps:

epochs.plot_projs_topomap(vlim="joint")

Expand Down

0 comments on commit 7c4e27c

Please sign in to comment.