[Mne_analysis] Mne_analysis Digest, Vol 157, Issue 7

Dan McCloy dan at mccloy.info
Wed Feb 10 12:18:20 EST 2021
Search archives:

        External Email - Use Caution        

Hi Bruno,
I think you must have called `plt.ion()` somewhere in your script. If I do that, I see figures briefly appear and then disappear. But without it, `show=False` works correctly and the figures never appear (but in either case the PNG files do get saved, and look correct).
-- dan
Daniel McCloy
https://secure-web.cisco.com/1oYeU8YqUJtFxVe-LJxUGx9QIMdYVhjhRx97ll4_X4La2kTucYQNEX9OIYn5_m1rtg4MnsGjdgpNCgOsjpXw2IYm8nlLmBjRp2FCfscl3fJ0VDVZs1jwPpiLQQ2w2qbtiplBYI92QemmEZK82vywSYSjY7DxtZ0_qX1gpwtVR4JV5GzDnhVK0b9QG7kmfqDiRLuHL_B23NZxFnvguvTKlA77Ytah45HstoEXSV17iMEhtfUvP_Th31dGZFwhkUauhkl_DgGM6qFSmqsNrny3y0Q/https%3A%2F%2Fdan.mccloy.info
Research Scientist
Institute for Learning and Brain Sciences
University of Washington

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, February 10, 2021 10:55 AM, Bruno Mansur <brunommansur at gmail.com> wrote:

> External Email - Use Caution
>
> Dear Daniel McCloy,
>
> Thanks a lot for your answer
>
> The solution you've sent me works correctly and the plots vanish right after appearing, what puts my script to work. My MNE info output is the following:
>
> Platform: Linux-5.8.0-43-generic-x86_64-with-glibc2.10
> Python: 3.8.6 | packaged by conda-forge | (default, Jan 25 2021, 23:21:18) [GCC 9.3.0]
> Executable: /home/bruno/anaconda3/envs/mne/bin/python
> CPU: x86_64: 8 cores
> Memory: 7.2 GB
>
> mne: 0.22.0
> numpy: 1.20.0 {blas=NO_ATLAS_INFO, lapack=lapack}
> scipy: 1.6.0
> matplotlib: 3.3.3 {backend=Qt5Agg}
>
> sklearn: 0.24.1
> numba: 0.52.0
> nibabel: 3.2.1
> nilearn: 0.7.0
> dipy: 1.3.0
> cupy: Not found
> pandas: 1.2.1
> mayavi: 4.7.2
> pyvista: 0.28.1 {pyvistaqt=0.3.0, OpenGL 4.6 (Core Profile) Mesa 20.2.6 via AMD RENOIR (DRM 3.38.0, 5.8.0-43-generic, LLVM 11.0.0)}
> vtk: 9.0.1
> PyQt5: 5.12.3
>
> Best regards
>
> Bruno
>
> Am Di., 9. Feb. 2021 um 18:01 Uhr schrieb <mne_analysis-request at nmr.mgh.harvard.edu>:
>
>> Send Mne_analysis mailing list submissions to
>> mne_analysis at nmr.mgh.harvard.edu
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> [MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1dSb-Ys-A8VMJO6mNhW-YmcLy9nhCQsspIx12bwmgUAXpkHtYlMTRzLJEzkb_06qSvNAA_uVoYvPgce5g6YqhF53_gesp7qkajSnPJ5qS5Ydr1UgqxdKx-_IYWKMM8PYD9zpEyqBNaZbrMcrDBH3l7Lv3bkgNUemTN3i1YOb6yBUWmDjeWyh13965A2q42LqqQSX1AsfyIzWXq8jgJG1H2KbbvRGA1POiSgTPxqr_WG2k1NuKYuqgbFU2wqXDM1TD34oLswpdWmcwxNQGXfcgmw/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis](https://secure-web.cisco.com/1zr4S2ICCfHzFKlNBNOO3Iy7UxzcqP4T5MyqBrDuwvPYL5F6LG8R16D3rRqeSX78A2XUf35ijRhXxZbi6q9tQQxf3aXSmteKVWA1B2kpJW_nuDhivtXsfFr_l9ODyjD4Rfv62vVGKOin2AIyOb7U94ARsyvKXYJdQrL5w-qcP6PiiQYqK7ts6v5aKVNQEfhdyiyqZPvQasovjSdez6Or5PDD1R4dn-wbi5dAMhhTYupX6VswkCQ5Z9OqTRNUB1n1s_7sMLKLhpIN-Ke3WO5Ia_g/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis)
>> or, via email, send a message with subject or body 'help' to
>> mne_analysis-request at nmr.mgh.harvard.edu
>>
>> You can reach the person managing the list at
>> mne_analysis-owner at nmr.mgh.harvard.edu
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Mne_analysis digest..."
>>
>> Today's Topics:
>>
>> 1. Re: Inhibit figure plot (Dan McCloy)
>> 2. [ANN] Save the date: MNE-Python Code Sprint (Dan McCloy)
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Mon, 08 Feb 2021 22:11:35 +0000
>> From: Dan McCloy <dan at mccloy.info>
>> Subject: Re: [Mne_analysis] Inhibit figure plot
>> To: Discussion and support forum for the users of MNE Software
>> <mne_analysis at nmr.mgh.harvard.edu>
>> Message-ID:
>> <2sKUhVqS0o-wlMSXxv50-_KS58nuquLHeIl1b10671TJiJPsn_iQpC5LmipYHCvFkc4rA06EjopcJmSwVKjblnSx1216GhqqQh_G6-ONtsw=@[MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be mccloy.info](http://secure-web.cisco.com/1hVnxFkdhVos2jk2or1gu971x4424Qv_0_Puvo6i2mDpIGba45yCp5bglRxlQ9B5KU5IMXiGXn_qHzVcjg5AfY7bcqh7y7oFJfhulgBnN51c1xXt8I3GWgteRl1RAFTV6rMccGlc2fhMDN0m8X3B4T5-fz9U9C6OziXXfa9PB1WRYTpImns2ac82c-eA6Twk-ZuFwiadPkiLu1j6Ir2vsMsQ3BbxZ4TOh38RemUzd13TIwtlbUMdrhvCkco1I6m_4scwSPGUDLU1CDaYjwQUFuQ/http%3A%2F%2Fmccloy.info)>
>>
>> Content-Type: text/plain; charset="utf-8"
>>
>> External Email - Use Caution
>>
>> Bruno,
>> Can you report your MNE-Python version info? For me the following works correctly (no plot windows are opened):
>>
>> import mne
>> import matplotlib.pyplot as plt
>> # do whatever needed to create your epochs, and then:
>> for ch in epochs.ch_names:
>> fig = epochs.plot_image(picks=ch, show=False)[0]
>> fig.savefig(f'epoch_image_{ch}.png')
>> plt.close(fig)
>>
>> -- dan
>> Daniel McCloy
>> https://secure-web.cisco.com/1fXQ6OxNSULyPm1L2l7FDpXOK9QJx_qnmalSfkpUy-b09M0r6-zmBvbLVUL44G3sncGTTOfsNY31t4xUZnaQ8CGPF6i51g4P8sgo2oWO6qphl2xmhuf0nz9swQUkvr3wqm29pS4attzCmgpP5_0pEe9KuMMZaNtvs2MbcfygmHcIbk_eEQYH774J-SQkA9dfch5QR6-ylK_vIjfwiCl-PibyJEskvzruxUtTTucqjyO5spn4mc7YSk85bdYfdBwax3N6uDHa3ZXxHCvtD--wpYg/https%3A%2F%2Fdan.mccloy.info
>> Research Scientist
>> Institute for Learning and Brain Sciences
>> University of Washington
>>
>> ??????? Original Message ???????
>> On Wednesday, February 3, 2021 6:05 PM, Bruno Mansur <brunommansur at gmail.com> wrote:
>>
>>> External Email - Use Caution
>>>
>>> Dear MNE list members,
>>>
>>> I have a script that generates several plots and it slows down the code execution speed:
>>>
>>> for ch in evoked_OGT.ch_names:
>>> fig = epochs_OGT.plot_image(picks=ch, title=ch+' '+'OGT', show=False)
>>> plt.savefig('/home//Evoked_OGT_%s.png'%(ch), show=False)
>>>
>>> Although I set 'show=false', the function 'plot_image' keeps opening new windows with figure plots. The output is not showing up in the console, but really opening new windows that I have to be closed every time I run the code.
>>>
>>> I'm using QT5 as a graphics backend option.
>>>
>>> Is there a way to stop mne functions from opening new windows?
>>>
>>> I would appreciate any help,
>>>
>>> Best regards,
>>>
>>> Bruno Mansur
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: [MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be http://secure-web.cisco.com/1Eak6AEpBuEOCUmhDSffAwuWc7Xb_w2rvmZGFFHmUHe4kvsBF7OLSuwTDWSX05RIgxX8OdyYv46oF9NHXAyDFP-gr-U6QhzmpKPAvB4ATRhqTfFOKanOp96300PllgFfqtwHgwphBuZFWt1SjjcoJlNnD-iViuZPnJUXo0u0hKGDbVkCnVV1AZZDX4sXbH9NQDlDwDPmY6G_NyJNeQbYt464B4qYdTHFR8P6BtNgRrcP18VaGOoBw-hnW0HTelLWpvvG1pFN7jjgXGbvSjLtsOw/http%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fpipermail%2Fmne_analysis%2Fattachments%2F20210208%2Fd668a4ff%2Fattachment-0001.html](http://secure-web.cisco.com/1bDf_b9yDDng2VKXlHGlrIeIWznwNgJr6XMTmjRTyVCQAYnghXe1Sew4a6ekYDonyjmym4w3ce6mK1MYdbxbqSz7EmX68mlL1zou1civQb4O80OTAsLPrjCy0aZhd5Csil3Dw_oGaaGxrFkLHzOWCNV8dPDOSdr8ky8Tr5VyR-1XDv9cC0bDB9uWfqnTuHAHaW__wOSw5BtJlQZYvdjGkmOLrkaH9h9yuBP-ShfOquIJhcEZ5dMeZZHMtaLl06qnLV_m8KybM4oIAMaqgYHYQtg/http%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fpipermail%2Fmne_analysis%2Fattachments%2F20210208%2Fd668a4ff%2Fattachment-0001.html)
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Mon, 08 Feb 2021 23:01:40 +0000
>> From: Dan McCloy <dan at mccloy.info>
>> Subject: [Mne_analysis] [ANN] Save the date: MNE-Python Code Sprint
>> To: Discussion and support forum for the users of MNE Software
>> <mne_analysis at nmr.mgh.harvard.edu>
>> Message-ID:
>> <M5w0PiJw1D6pLG3K9mrsamRyhQmJzpk6MTtyPwOFcvTztFJ3x1R0IJ5fnYAcARtPlOhYXhzpd2uOGqY2xMjtgAja1Tk5CWWwBy0-g615Mc0=@[MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be mccloy.info](http://secure-web.cisco.com/1hVnxFkdhVos2jk2or1gu971x4424Qv_0_Puvo6i2mDpIGba45yCp5bglRxlQ9B5KU5IMXiGXn_qHzVcjg5AfY7bcqh7y7oFJfhulgBnN51c1xXt8I3GWgteRl1RAFTV6rMccGlc2fhMDN0m8X3B4T5-fz9U9C6OziXXfa9PB1WRYTpImns2ac82c-eA6Twk-ZuFwiadPkiLu1j6Ir2vsMsQ3BbxZ4TOh38RemUzd13TIwtlbUMdrhvCkco1I6m_4scwSPGUDLU1CDaYjwQUFuQ/http%3A%2F%2Fmccloy.info)>
>>
>> Content-Type: text/plain; charset="utf-8"
>>
>> External Email - Use Caution
>>
>> SAVE THE DATE: The next MNE-Python Code Sprint will take place Mon-Fri, 15-19 March 2021, using the online platform Discord (the same place we've been holding "office hours"). We are focusing this code sprint on the training of new contributors, and thanks to a generous grant from CZI, there will be stipends available for participants, with priority given to members of populations that are underrepresented in academic neuroscience. Several core devs and experienced contributors will act as mentors, working all week with new contributors to get them up to speed on git, GitHub, and the entire MNE-Python contribution process.
>>
>> Because of our decision to organize this sprint as a structured training event rather than the usual pair-programming free-for-all, it will be necessary to limit attendance (to make sure there are enough mentors available to guide all the new contributors). Details on the application process will follow soon. Experienced contributors who are interested in serving as mentors during the sprint should contact me (dan at mccloy.info) as soon as possible to discuss availability.
>>
>> In addition to the structured training, we plan to have a "drop-in" room in Discord where experienced devs not serving as mentors can gather for some unsupervised pair programming, with the understanding that many of the core devs will be unavailable for questions/code review due to mentoring responsibilities.
>>
>> As mentioned above, stay tuned for detailed application instructions soon. For any other questions, please feel free to contact me directly.
>>
>> -- dan
>> Daniel McCloy
>> https://secure-web.cisco.com/1cBKk51QCAm5Eyb-EVNb9tQ55NIFBE5RDPkf1C6aATD-p3_IB0hmKvW16FZGRzsUAiJhirlMbYi7lLUVCnG0Iq-GL5aldLyx_qftla6Glu9opsb6RTMvHF1JPFU2ggjLYYGnY4pmK7MIjGFI5cJneyc8x5nCs4XS5Wxplk0yhNTBI6YMiuZkfcbxSkB2IPCcksjSRYLWveqUXGU9c-zKAI7jKDDNvPF-XTCO6f3Hd6C1Q-91gE76OLQ9w52FiatWPUGHLGo6t5L2d9UrSkzGO3w/https%3A%2F%2Fdan.mccloy.info
>> Research Scientist
>> Institute for Learning and Brain Sciences
>> University of Washington
>>
>> ------------------------------
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> [MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1dSb-Ys-A8VMJO6mNhW-YmcLy9nhCQsspIx12bwmgUAXpkHtYlMTRzLJEzkb_06qSvNAA_uVoYvPgce5g6YqhF53_gesp7qkajSnPJ5qS5Ydr1UgqxdKx-_IYWKMM8PYD9zpEyqBNaZbrMcrDBH3l7Lv3bkgNUemTN3i1YOb6yBUWmDjeWyh13965A2q42LqqQSX1AsfyIzWXq8jgJG1H2KbbvRGA1POiSgTPxqr_WG2k1NuKYuqgbFU2wqXDM1TD34oLswpdWmcwxNQGXfcgmw/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis](https://secure-web.cisco.com/1zr4S2ICCfHzFKlNBNOO3Iy7UxzcqP4T5MyqBrDuwvPYL5F6LG8R16D3rRqeSX78A2XUf35ijRhXxZbi6q9tQQxf3aXSmteKVWA1B2kpJW_nuDhivtXsfFr_l9ODyjD4Rfv62vVGKOin2AIyOb7U94ARsyvKXYJdQrL5w-qcP6PiiQYqK7ts6v5aKVNQEfhdyiyqZPvQasovjSdez6Or5PDD1R4dn-wbi5dAMhhTYupX6VswkCQ5Z9OqTRNUB1n1s_7sMLKLhpIN-Ke3WO5Ia_g/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis)
>>
>> End of Mne_analysis Digest, Vol 157, Issue 7
>> ********************************************
>
> --
> Bruno de Matos Mansur, M.Sc.
> Neurocybernetics und Rehabilitation
> University Hospital Magdeburg
> Leipziger Strasse 44, 39120 Magdeburg, Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20210210/2cf7b3af/attachment-0001.html 


More information about the Mne_analysis mailing list