Troubling getting red-lines and other figure elements to display on plot_bridged_electrodes

Hello! I am trying to create a PyInstaller executable for bridge_detection and I am having trouble getting my plot_bridged_electrodes interactive matplotlib fig to display the red lines linking channels and title. Here is what they currently look like:

I would like them to look like this:
image

I am able to get everything working using non interactive figures, but the interactive figures do not work. I would appreciate if anyone had any insight pn this issue :slight_smile:!

Code:

import sys
import time
import matplotlib.pyplot as plt
import matplotlib.image as img
import matplotlib
import os
matplotlib.use('qtagg')
import mne


montage_1020 = mne.channels.make_standard_montage("standard_1020")
# Lower everything to lower case in montage channels
montage_channels = [ch.lower() for ch in montage_1020.ch_names]
raw_fname = mne.datasets.eegbci.load_data(subject=1, runs=(1,))[0]
raw = mne.io.read_raw(raw_fname, preload=True, verbose=False)
raw.rename_channels(lambda x: x.lower())
mne.datasets.eegbci.standardize(raw)  # set channel names
raw.set_montage(montage_1020, verbose=False)

print(f"Searching for bridges...")
bridged_idx, ed_matrix = mne.preprocessing.compute_bridged_electrodes(raw)

mne.viz.plot_bridged_electrodes(
    raw.info,
    bridged_idx,
    ed_matrix,
    title=f"{raw_fname} bridged: {len(bridged_idx)}",
    topomap_args=dict(vlim=(None, 5))
)

Platform             Windows-10-10.0.23620-SP0
Python               3.11.7 | packaged by conda-forge | (main, Dec 23 2023, 14:27:59) [MSC v.1937 64 bit (AMD64)]
Executable           C:\Users\woess\Desktop\EEG_QC\python.exe
CPU                  AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD (12 cores)
Memory               23.2 GB

Core
├☑ mne               1.6.1 (latest release)
├☑ numpy             1.26.3 (OpenBLAS 0.3.26 with 12 threads)
├☑ scipy             1.12.0
├☑ matplotlib        3.8.2 (backend=QtAgg)
├☑ pooch             1.8.0
└☑ jinja2            3.1.3

Numerical (optional)
├☑ sklearn           1.4.0
├☑ numba             0.59.0
├☑ nibabel           5.2.0
├☑ nilearn           0.10.3
├☑ dipy              1.7.0
├☑ openmeeg          2.5.7
├☑ pandas            2.2.0
└☐ unavailable       cupy

Visualization (optional)
├☑ pyvista           0.43.2 (OpenGL 4.6.0 Compatibility Profile Context 23.10.24.05.230830 via AMD Radeon(TM) Graphics)
├☑ pyvistaqt         0.11.0
├☑ vtk               9.2.6
├☑ qtpy              2.4.1 (PyQt5=5.15.8)
├☑ pyqtgraph         0.13.3
├☑ mne-qt-browser    0.6.1
├☑ ipywidgets        8.1.1
├☑ trame_client      2.15.0
├☑ trame_server      2.16.0
├☑ trame_vtk         2.8.0
├☑ trame_vuetify     2.4.2
└☐ unavailable       ipympl

Ecosystem (optional)
└☐ unavailable       mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline
1 Like