You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to plot multiple connectograms on a single figure. For that I am following the tutorial and call mne_connectivity.viz.plot_connectivity_circle in a for-loop each time passing the respective ax object to the function. I am using Spyder as IDE (not sure if this is the problem). It seems that the function seems to render the full figure at each iteration (?) leading to only the first ax being visible. The others are empty. I can solve this problem by simply calling fig again one more time after the for-loop has finished:
My immediate thought is that this is just a plotting backend thing/whether its run in interactive mode or not. Like the the example shows, by the end of the for loop all subplots should be rendered.
If you get different behaviour with your setup you could just set plot=False for each iteration of the for loop, then afterwards call plt.show(). The show parameter has been present ever since the visualisation functions were ported over, so I wouldn't say the example is outdated.
Describe the bug
I want to plot multiple connectograms on a single figure. For that I am following the tutorial and call
mne_connectivity.viz.plot_connectivity_circle
in a for-loop each time passing the respectiveax
object to the function. I am using Spyder as IDE (not sure if this is the problem). It seems that the function seems to render the full figure at each iteration (?) leading to only the first ax being visible. The others are empty. I can solve this problem by simply callingfig
again one more time after the for-loop has finished:After running
fig
one more time:Steps to reproduce
Execute code from example
Expected results
Don't render figure until all subplots have been populated.
Additional information
mne.sys_info()
Platform Linux-5.15.0-116-generic-x86_64-with-glibc2.35
Python 3.9.20 | packaged by conda-forge | (main, Sep 30 2024, 17:49:10) [GCC 13.3.0]
Executable /zi/home/johannes.wiesner/micromamba/envs/csp_wiesner_johannes/bin/python
CPU x86_64 (32 cores)
Memory 62.7 GB
Core
├☑ mne 1.8.0 (latest release)
├☑ numpy 1.26.4 (OpenBLAS 0.3.27 with 32 threads)
├☑ scipy 1.13.1
└☑ matplotlib 3.7.3 (backend=module://matplotlib_inline.backend_inline)
Numerical (optional)
├☑ sklearn 1.5.2
├☑ numba 0.60.0
├☑ nibabel 5.3.1
├☑ nilearn 0.9.0
├☑ pandas 2.2.2
├☑ h5py 3.12.1
└☐ unavailable dipy, openmeeg, cupy, h5io
Visualization (optional)
├☑ qtpy 2.4.1 (PyQt5=5.15.8)
└☐ unavailable pyvista, pyvistaqt, vtk, ipympl, pyqtgraph, mne-qt-browser, ipywidgets, trame_client, trame_server, trame_vtk, trame_vuetify
Ecosystem (optional)
├☑ mne-connectivity 0.7.0
└☐ unavailable mne-bids, mne-nirs, mne-features, mne-icalabel, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv
The text was updated successfully, but these errors were encountered: