I have to add block=True in order to view the plot on raw.plot otherwise it’ll close as soon as it opens up.
but ica.plot_properties(raw, picks=ica.exclude) doesn’t require that? Why? Is this a system design choice?
Plotting tools with a block argument tend to be those which open browsing figures (those that you scroll through), e.g., Epochs.plot, ICA.plot_sources.
In contrast, those that produce more ‘static’ figures don’t have a block argument, e.g., ICA.plot_properties, Spectrum.plot. At least for me (and also seems for you), running these in a file effectively acts as if block=True.
Why the more static plotting doesn’t have a block param and why the default seems to be opposite of that for browsing figures, I’m not sure. Perhaps @larsoner knows?
Does raw.plot() open the mne-qt-browser window, while ica.plot_properties() opens a matplotlib figure? Two different plotting engines could explain the difference.
Hmm this part is not good. If you do fig = raw.plot(…) does it stay up? The intended behavior is that it shows up but does not block execution.
If adding fig = … does fix it, it suggests it’s due to garbage collection – no ref to the figure is maintained so it gets GC’ed and closed. Plotting libraries usually take care of this by keeping a ref to all figures they’ve created in their own _ALL_PLOTTERS for example. We should probably implement this at the mne-qt-browser end if needed