<div dir="ltr">I have <span style="font-family:arial,sans-serif;font-size:13px">imported </span><span style="font-family:arial,sans-serif;font-size:13px">matplotlib.use(&#39;Agg&#39;) before </span><span style="font-family:arial,sans-serif;font-size:13px">matplotlib.pyplot as plt and also tried import it after </span><span style="font-size:13px;font-family:arial,sans-serif">matplotlib.pyplot but the result is the same.</span><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">-Maria </span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-08-17 22:35 GMT+03:00 Denis-Alexander Engemann <span dir="ltr">&lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Maria,<br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Sun, Aug 17, 2014 at 9:18 PM, Maria Hakonen <span dir="ltr">&lt;<a href="mailto:maria.hakonen@gmail.com" target="_blank">maria.hakonen@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I tried to activate Agg by adding matplotlib.use(&#39;Agg&#39;) in my code. Before it I have imported:</div>


<div><br></div></div></blockquote><div><br></div></div><div>matplotlib.use(&#39;Agg&#39;) must be importet before<br></div><div class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div dir="ltr"><div></div><div>import numpy as np</div><div>import mne</div>
<div>from <a href="http://mne.io" target="_blank">mne.io</a> import Raw</div><div>import os</div><div>from mne.preprocessing import ICA, create_eog_epochs</div><div>import matplotlib</div></div></blockquote><div><br></div>


</div><div>the line below</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
<div>
import matplotlib.pyplot as plt</div>
<div><br></div></div></blockquote><div><br></div><div>can you confirm this is the case?</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div dir="ltr"><div>
</div><div>I also added plt.close(&#39;all&#39;) at the end of the code.</div><div>I started python without --pylab qt flag (i.e. typing ipython).</div><div><br></div><div>However, I think that Agg is not activated because the script still plots the figures and waits until the figure is closed.</div>



<div><br></div><div>-Maria </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-17 19:32 GMT+03:00 Denis-Alexander Engemann <span dir="ltr">&lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt;</span>:<div>


<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Maria, does this happen for all plots that you try not to show? Might be a bug in that particular function.</div>



<div class="gmail_extra"><br></div><div class="gmail_extra">Btw. what did you mean when you said the script is running very long time?</div>

<div class="gmail_extra">You mean it hangs (because it&#39;s waiting for you to close the figures)?</div><div class="gmail_extra">Have you been able to activate the &#39;Agg&#39; silent backend using the lines I suggested?</div>



<span><font color="#888888">

<div class="gmail_extra"><br></div><div class="gmail_extra">-Denis</div></font></span><div><div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Sun, Aug 17, 2014 at 6:27 PM, Maria Hakonen <span dir="ltr">&lt;<a href="mailto:maria.hakonen@gmail.com" target="_blank">maria.hakonen@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I have set the show parameter false as follows:<div>


 ica.plot_sources(epochs_bp,eog_inds,show=False)</div>


<div><br></div><div>However, the figures are still shown. I wonder what could be wrong there?</div><div>
<br></div><div>-Maria</div><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-17 16:26 GMT+03:00 Alexandre Gramfort <span dir="ltr">&lt;<a href="mailto:alexandre.gramfort@telecom-paristech.fr" target="_blank">alexandre.gramfort@telecom-paristech.fr</a>&gt;</span>:<div>





<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">hi Maria,<br>
<div><br>
&gt; Thanks for the answer.<br>
&gt; However, the script seems to run very long time if ipython is started<br>
&gt; without --pylab qt flag. I wonder if there is any other ways to save the<br>
&gt; figures in the loop without displaying them?<br>
<br>
</div>most viz functions have a show parameter that is true by default. Set it<br>
to false to avoid showing the figures.<br>
<br>
HTH<br>
Alex<br>
<div><div>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br>
</div></div></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div></div></div></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div></div></div><br></div></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>