Re: [Matplotlib-users] suppress plotting window
Hi Ben, yes, it is not enabled. Also a call to pyplot.isinteractive() returns False. Maximilian On Mon, Jun 18, 2012 at 3:02 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, Jun 18, 2012 at 3:36 AM, Maximilian Fabricius mfabric...@gmail.com wrote: On Tue, Jun 12, 2012 at 6:40 PM, John Hunter jdh2...@gmail.com wrote: On Fri, Jun 8, 2012 at 3:36 AM, Maximilian Fabricius mfabric...@gmail.com wrote: it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only Before importing pylab, do import matplotlib matplotlib.use('pdf') The FAQ for using mpl in a web app server is pretty relevant to this use case http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server JDH Hi John, yes, I can do a matplotlib.use('pdf') (As a matter of fact I use this as a workaround right now). But I have to do this at the very beginning of the code, i.e. before the import of pyplot. Now, my routine has a --PLOT switch which allows me to turn on the on-screen plotting. Depending on that switch I now have to decide whether or not to call matplotlib.use('pdf'). This means that I have a lot of imports interspersed with other code which looks terrible. Really I am pretty sure that a simple script like: from matplotlib import pyplot as pp pp.plot([1,2,3]) should not open a window. Only after a pp.show() the window should show up. Note: I have tried to remove my .matplotlib directory. I have also checked pp.isinteractive() False Any help would be highly appreciated. Maximilian Maxmillian, Did you check your ~/.matplotlib/matplotlibrc file like I suggested? By default, these plots should not be coming up until you call show(). However, if interactive is set to True, then they will come up at the first plotting command. Cheers! Ben Root -- Maximilian Fabricius * Max Planck Institute for Extraterrestrial Physics (MPE) Giessenbachstrasse, D-85748 Garching, Germany * University Observatory Munich / Wendelstein Observatory Scheinerstr. 1, D-81679 München, Germany eMail: m...@mpe.mpg.de Phone: +49 89 3 3779 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] suppress plotting window
2012/6/8 Maximilian Fabricius mfabric...@gmail.com: Hi all, it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only when I pass a command line option the script should actually open a window and also display the results on the screen. I am pretty sure that in earlier times the window would only open when I call pylab.show(). It may well be that I messed too much with my matplotlibrc, if you could just point me in the right direction ... I use matplotlib 1.0.1 on a Mac with the MacOSX backend. From http://matplotlib.sourceforge.net/faq/usage_faq.html#non-interactive-example: -- import matplotlib.pyplot as plt plt.ioff() plt.plot([1.6, 2.7]) Nothing happened–or at least nothing has shown up on the screen (unless you are using macosx backend, which is anomalous). -- Goyo -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] suppress plotting window
Hi Goyo, I see! I am using the macosx backend. That was the hint I needed. Thanks a lot! Maximilian On Tue, Jun 19, 2012 at 9:27 PM, Goyo goyod...@gmail.com wrote: 2012/6/8 Maximilian Fabricius mfabric...@gmail.com: Hi all, it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only when I pass a command line option the script should actually open a window and also display the results on the screen. I am pretty sure that in earlier times the window would only open when I call pylab.show(). It may well be that I messed too much with my matplotlibrc, if you could just point me in the right direction ... I use matplotlib 1.0.1 on a Mac with the MacOSX backend. From http://matplotlib.sourceforge.net/faq/usage_faq.html#non-interactive-example: -- import matplotlib.pyplot as plt plt.ioff() plt.plot([1.6, 2.7]) Nothing happened–or at least nothing has shown up on the screen (unless you are using macosx backend, which is anomalous). -- Goyo -- Maximilian Fabricius * Max Planck Institute for Extraterrestrial Physics (MPE) Giessenbachstrasse, D-85748 Garching, Germany * University Observatory Munich / Wendelstein Observatory Scheinerstr. 1, D-81679 München, Germany eMail: m...@mpe.mpg.de Phone: +49 89 3 3779 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] suppress plotting window
On Tue, Jun 12, 2012 at 6:40 PM, John Hunter jdh2...@gmail.com wrote: On Fri, Jun 8, 2012 at 3:36 AM, Maximilian Fabricius mfabric...@gmail.com wrote: it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only Before importing pylab, do import matplotlib matplotlib.use('pdf') The FAQ for using mpl in a web app server is pretty relevant to this use case http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server JDH Hi John, yes, I can do a matplotlib.use('pdf') (As a matter of fact I use this as a workaround right now). But I have to do this at the very beginning of the code, i.e. before the import of pyplot. Now, my routine has a --PLOT switch which allows me to turn on the on-screen plotting. Depending on that switch I now have to decide whether or not to call matplotlib.use('pdf'). This means that I have a lot of imports interspersed with other code which looks terrible. Really I am pretty sure that a simple script like: from matplotlib import pyplot as pp pp.plot([1,2,3]) should not open a window. Only after a pp.show() the window should show up. Note: I have tried to remove my .matplotlib directory. I have also checked pp.isinteractive() False Any help would be highly appreciated. Maximilian -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] suppress plotting window
On Mon, Jun 18, 2012 at 3:36 AM, Maximilian Fabricius mfabric...@gmail.comwrote: On Tue, Jun 12, 2012 at 6:40 PM, John Hunter jdh2...@gmail.com wrote: On Fri, Jun 8, 2012 at 3:36 AM, Maximilian Fabricius mfabric...@gmail.com wrote: it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only Before importing pylab, do import matplotlib matplotlib.use('pdf') The FAQ for using mpl in a web app server is pretty relevant to this use case http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server JDH Hi John, yes, I can do a matplotlib.use('pdf') (As a matter of fact I use this as a workaround right now). But I have to do this at the very beginning of the code, i.e. before the import of pyplot. Now, my routine has a --PLOT switch which allows me to turn on the on-screen plotting. Depending on that switch I now have to decide whether or not to call matplotlib.use('pdf'). This means that I have a lot of imports interspersed with other code which looks terrible. Really I am pretty sure that a simple script like: from matplotlib import pyplot as pp pp.plot([1,2,3]) should not open a window. Only after a pp.show() the window should show up. Note: I have tried to remove my .matplotlib directory. I have also checked pp.isinteractive() False Any help would be highly appreciated. Maximilian Maxmillian, Did you check your ~/.matplotlib/matplotlibrc file like I suggested? By default, these plots should not be coming up until you call show(). However, if interactive is set to True, then they will come up at the first plotting command. Cheers! Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] suppress plotting window
On Fri, Jun 8, 2012 at 4:36 AM, Maximilian Fabricius mfabric...@gmail.comwrote: Hi all, it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only when I pass a command line option the script should actually open a window and also display the results on the screen. I am pretty sure that in earlier times the window would only open when I call pylab.show(). It may well be that I messed too much with my matplotlibrc, if you could just point me in the right direction ... I use matplotlib 1.0.1 on a Mac with the MacOSX backend. Maximilian You should see if you accidentially turned on the interactive mode. Just make sure that the interactive setting is set to False. Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] suppress plotting window
On Fri, Jun 8, 2012 at 3:36 AM, Maximilian Fabricius mfabric...@gmail.com wrote: it seems that whenever I plot something, a window opens. from matplotlib import pylab import numpy pylab.plot(numpy.random.normal(size=100)) Now, I have code that is supposed to produce diagnostic plots as PDFs. Only Before importing pylab, do import matplotlib matplotlib.use('pdf') The FAQ for using mpl in a web app server is pretty relevant to this use case http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server JDH -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users