From: Federico A. <ari...@gm...> - 2013-10-11 16:57:53
|
Hello everybody Working on one GTK3 app, that calls matplotlib to plot some figures, I found that closing all the figures from matplotlib kills my app also. The problem.... Gtk.main() is called only if there is no previous invocation, in my case, my Gtk3 app invokes main, so the mainloop won't call it again. #in backend_gtk3.py # class Show(ShowBase): def mainloop(self): if Gtk.main_level() == 0: Gtk.main() But in the "destroy" method of the figure manager calls Gtk.main_quit everytime that there are no more figures #in backend_gtk3.py inside destroy method of FigureManagerGTK3 # if Gcf.get_num_fig_managers()==0 and \ not matplotlib.is_interactive() and \ Gtk.main_level() >= 1: Gtk.main_quit() So basically we are not calling Gtk.main but we are Gtk.calling main_quit. Isn't it more natural to call Gtk.main the same amount of times that we are going to call Gtk.main_quit? Adding matplotlib.rcParams['interactive'] = True doesn't help Here is my little testing code ############################## #file myapp.py import matplotlib matplotlib.rcParams['interactive'] = True matplotlib.use('GTK3AGG') import matplotlib.pyplot as plt from gi.repository import Gtk class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Hello World") self.button = Gtk.Button(label="Click Here") self.button.connect("clicked", self.on_button_clicked) self.add(self.button) def on_button_clicked(self, widget): fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,2,3]) plt.show() win = MyWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() ######################### I know this is related to interactive mode, but running from console >>> python myapp.py reproduces the problem Why hasattr(sys, 'ps1') is False? if I am running it from console? how do I change this? Thanks Federico P.S. Does anybody had the time to check my PR for multi-figure-manager? https://github.com/matplotlib/matplotlib/pull/2465 -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
From: Thomas A C. <tca...@uc...> - 2013-10-11 17:11:40
|
If you are embedding matplotlib, do not import `pyplot`. `pyplot` sets up a bunch of gui-magic (tm) in the background (as you found in `figure_manager`). Tom On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza <ari...@gm...>wrote: > Hello everybody > > Working on one GTK3 app, that calls matplotlib to plot some figures, I > found that closing all the figures from matplotlib kills my app also. > The problem.... > > Gtk.main() is called only if there is no previous invocation, in my > case, my Gtk3 app invokes main, so the mainloop won't call it again. > > #in backend_gtk3.py > # > class Show(ShowBase): > def mainloop(self): > if Gtk.main_level() == 0: > Gtk.main() > > But in the "destroy" method of the figure manager calls Gtk.main_quit > everytime that there are no more figures > > #in backend_gtk3.py inside destroy method of FigureManagerGTK3 > # > if Gcf.get_num_fig_managers()==0 and \ > not matplotlib.is_interactive() and \ > Gtk.main_level() >= 1: > Gtk.main_quit() > > > So basically we are not calling Gtk.main but we are Gtk.calling main_quit. > Isn't it more natural to call Gtk.main the same amount of times that > we are going to call Gtk.main_quit? > > Adding matplotlib.rcParams['interactive'] = True doesn't help > > Here is my little testing code > > ############################## > #file myapp.py > > import matplotlib > matplotlib.rcParams['interactive'] = True > matplotlib.use('GTK3AGG') > import matplotlib.pyplot as plt > > from gi.repository import Gtk > > class MyWindow(Gtk.Window): > > def __init__(self): > Gtk.Window.__init__(self, title="Hello World") > > self.button = Gtk.Button(label="Click Here") > self.button.connect("clicked", self.on_button_clicked) > self.add(self.button) > > def on_button_clicked(self, widget): > fig = plt.figure() > ax = fig.add_subplot(111) > ax.plot([1,2,3]) > plt.show() > > win = MyWindow() > win.connect("delete-event", Gtk.main_quit) > win.show_all() > Gtk.main() > ######################### > > I know this is related to interactive mode, but running from console > >>> python myapp.py > reproduces the problem > > Why hasattr(sys, 'ps1') is False? if I am running it from console? how > do I change this? > > > Thanks > Federico > > P.S. Does anybody had the time to check my PR for multi-figure-manager? > https://github.com/matplotlib/matplotlib/pull/2465 > > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- Thomas A Caswell PhD Candidate University of Chicago Nagel and Gardel labs tca...@uc... jfi.uchicago.edu/~tcaswell o: 773.702.7204 |
From: Federico A. <ari...@gm...> - 2013-10-11 17:13:13
|
I am not embedding, just launching, as the example shows. Federico On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell <tca...@uc...> wrote: > If you are embedding matplotlib, do not import `pyplot`. `pyplot` sets up a > bunch of gui-magic (tm) in the background (as you found in > `figure_manager`). > > Tom > > > On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza <ari...@gm...> > wrote: >> >> Hello everybody >> >> Working on one GTK3 app, that calls matplotlib to plot some figures, I >> found that closing all the figures from matplotlib kills my app also. >> The problem.... >> >> Gtk.main() is called only if there is no previous invocation, in my >> case, my Gtk3 app invokes main, so the mainloop won't call it again. >> >> #in backend_gtk3.py >> # >> class Show(ShowBase): >> def mainloop(self): >> if Gtk.main_level() == 0: >> Gtk.main() >> >> But in the "destroy" method of the figure manager calls Gtk.main_quit >> everytime that there are no more figures >> >> #in backend_gtk3.py inside destroy method of FigureManagerGTK3 >> # >> if Gcf.get_num_fig_managers()==0 and \ >> not matplotlib.is_interactive() and \ >> Gtk.main_level() >= 1: >> Gtk.main_quit() >> >> >> So basically we are not calling Gtk.main but we are Gtk.calling main_quit. >> Isn't it more natural to call Gtk.main the same amount of times that >> we are going to call Gtk.main_quit? >> >> Adding matplotlib.rcParams['interactive'] = True doesn't help >> >> Here is my little testing code >> >> ############################## >> #file myapp.py >> >> import matplotlib >> matplotlib.rcParams['interactive'] = True >> matplotlib.use('GTK3AGG') >> import matplotlib.pyplot as plt >> >> from gi.repository import Gtk >> >> class MyWindow(Gtk.Window): >> >> def __init__(self): >> Gtk.Window.__init__(self, title="Hello World") >> >> self.button = Gtk.Button(label="Click Here") >> self.button.connect("clicked", self.on_button_clicked) >> self.add(self.button) >> >> def on_button_clicked(self, widget): >> fig = plt.figure() >> ax = fig.add_subplot(111) >> ax.plot([1,2,3]) >> plt.show() >> >> win = MyWindow() >> win.connect("delete-event", Gtk.main_quit) >> win.show_all() >> Gtk.main() >> ######################### >> >> I know this is related to interactive mode, but running from console >> >>> python myapp.py >> reproduces the problem >> >> Why hasattr(sys, 'ps1') is False? if I am running it from console? how >> do I change this? >> >> >> Thanks >> Federico >> >> P.S. Does anybody had the time to check my PR for multi-figure-manager? >> https://github.com/matplotlib/matplotlib/pull/2465 >> >> -- >> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >> >> -- Antonio Alducin -- >> >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >> from >> the latest Intel processors and coprocessors. See abstracts and register > >> >> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > > -- > Thomas A Caswell > PhD Candidate University of Chicago > Nagel and Gardel labs > tca...@uc... > jfi.uchicago.edu/~tcaswell > o: 773.702.7204 -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
From: Federico A. <ari...@gm...> - 2013-10-11 17:15:09
|
Again In the example the plotting is inside the callback (just for simplicity), but in reality, the plotting is in another class, somewhere else that can be called standalone to produce the plots. Federico On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza <ari...@gm...> wrote: > I am not embedding, just launching, as the example shows. > > Federico > > On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell <tca...@uc...> wrote: >> If you are embedding matplotlib, do not import `pyplot`. `pyplot` sets up a >> bunch of gui-magic (tm) in the background (as you found in >> `figure_manager`). >> >> Tom >> >> >> On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza <ari...@gm...> >> wrote: >>> >>> Hello everybody >>> >>> Working on one GTK3 app, that calls matplotlib to plot some figures, I >>> found that closing all the figures from matplotlib kills my app also. >>> The problem.... >>> >>> Gtk.main() is called only if there is no previous invocation, in my >>> case, my Gtk3 app invokes main, so the mainloop won't call it again. >>> >>> #in backend_gtk3.py >>> # >>> class Show(ShowBase): >>> def mainloop(self): >>> if Gtk.main_level() == 0: >>> Gtk.main() >>> >>> But in the "destroy" method of the figure manager calls Gtk.main_quit >>> everytime that there are no more figures >>> >>> #in backend_gtk3.py inside destroy method of FigureManagerGTK3 >>> # >>> if Gcf.get_num_fig_managers()==0 and \ >>> not matplotlib.is_interactive() and \ >>> Gtk.main_level() >= 1: >>> Gtk.main_quit() >>> >>> >>> So basically we are not calling Gtk.main but we are Gtk.calling main_quit. >>> Isn't it more natural to call Gtk.main the same amount of times that >>> we are going to call Gtk.main_quit? >>> >>> Adding matplotlib.rcParams['interactive'] = True doesn't help >>> >>> Here is my little testing code >>> >>> ############################## >>> #file myapp.py >>> >>> import matplotlib >>> matplotlib.rcParams['interactive'] = True >>> matplotlib.use('GTK3AGG') >>> import matplotlib.pyplot as plt >>> >>> from gi.repository import Gtk >>> >>> class MyWindow(Gtk.Window): >>> >>> def __init__(self): >>> Gtk.Window.__init__(self, title="Hello World") >>> >>> self.button = Gtk.Button(label="Click Here") >>> self.button.connect("clicked", self.on_button_clicked) >>> self.add(self.button) >>> >>> def on_button_clicked(self, widget): >>> fig = plt.figure() >>> ax = fig.add_subplot(111) >>> ax.plot([1,2,3]) >>> plt.show() >>> >>> win = MyWindow() >>> win.connect("delete-event", Gtk.main_quit) >>> win.show_all() >>> Gtk.main() >>> ######################### >>> >>> I know this is related to interactive mode, but running from console >>> >>> python myapp.py >>> reproduces the problem >>> >>> Why hasattr(sys, 'ps1') is False? if I am running it from console? how >>> do I change this? >>> >>> >>> Thanks >>> Federico >>> >>> P.S. Does anybody had the time to check my PR for multi-figure-manager? >>> https://github.com/matplotlib/matplotlib/pull/2465 >>> >>> -- >>> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >>> >>> -- Antonio Alducin -- >>> >>> >>> ------------------------------------------------------------------------------ >>> October Webinars: Code for Performance >>> Free Intel webinars can help you accelerate application performance. >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >>> from >>> the latest Intel processors and coprocessors. See abstracts and register > >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Matplotlib-devel mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> >> >> >> >> -- >> Thomas A Caswell >> PhD Candidate University of Chicago >> Nagel and Gardel labs >> tca...@uc... >> jfi.uchicago.edu/~tcaswell >> o: 773.702.7204 > > > > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
From: Thomas A C. <tca...@uc...> - 2013-10-11 17:33:00
|
embedding vs launching is a distinction without a difference, you are integrating matplotlib with your own gui application. That said, it would be nice to re-factor the figure_manager classes so they they make no reference to `Gcf` or anything associated with pylab and could be easily re-used. I think that would also help with the issues in https://github.com/matplotlib/matplotlib/pull/2503 Tom On Fri, Oct 11, 2013 at 12:14 PM, Federico Ariza <ari...@gm...>wrote: > Again > > In the example the plotting is inside the callback (just for > simplicity), but in reality, the plotting is in another class, > somewhere else that can be called standalone to produce the plots. > > Federico > > On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza > <ari...@gm...> wrote: > > I am not embedding, just launching, as the example shows. > > > > Federico > > > > On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell <tca...@uc...> > wrote: > >> If you are embedding matplotlib, do not import `pyplot`. `pyplot` sets > up a > >> bunch of gui-magic (tm) in the background (as you found in > >> `figure_manager`). > >> > >> Tom > >> > >> > >> On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza < > ari...@gm...> > >> wrote: > >>> > >>> Hello everybody > >>> > >>> Working on one GTK3 app, that calls matplotlib to plot some figures, I > >>> found that closing all the figures from matplotlib kills my app also. > >>> The problem.... > >>> > >>> Gtk.main() is called only if there is no previous invocation, in my > >>> case, my Gtk3 app invokes main, so the mainloop won't call it again. > >>> > >>> #in backend_gtk3.py > >>> # > >>> class Show(ShowBase): > >>> def mainloop(self): > >>> if Gtk.main_level() == 0: > >>> Gtk.main() > >>> > >>> But in the "destroy" method of the figure manager calls Gtk.main_quit > >>> everytime that there are no more figures > >>> > >>> #in backend_gtk3.py inside destroy method of FigureManagerGTK3 > >>> # > >>> if Gcf.get_num_fig_managers()==0 and \ > >>> not matplotlib.is_interactive() and \ > >>> Gtk.main_level() >= 1: > >>> Gtk.main_quit() > >>> > >>> > >>> So basically we are not calling Gtk.main but we are Gtk.calling > main_quit. > >>> Isn't it more natural to call Gtk.main the same amount of times that > >>> we are going to call Gtk.main_quit? > >>> > >>> Adding matplotlib.rcParams['interactive'] = True doesn't help > >>> > >>> Here is my little testing code > >>> > >>> ############################## > >>> #file myapp.py > >>> > >>> import matplotlib > >>> matplotlib.rcParams['interactive'] = True > >>> matplotlib.use('GTK3AGG') > >>> import matplotlib.pyplot as plt > >>> > >>> from gi.repository import Gtk > >>> > >>> class MyWindow(Gtk.Window): > >>> > >>> def __init__(self): > >>> Gtk.Window.__init__(self, title="Hello World") > >>> > >>> self.button = Gtk.Button(label="Click Here") > >>> self.button.connect("clicked", self.on_button_clicked) > >>> self.add(self.button) > >>> > >>> def on_button_clicked(self, widget): > >>> fig = plt.figure() > >>> ax = fig.add_subplot(111) > >>> ax.plot([1,2,3]) > >>> plt.show() > >>> > >>> win = MyWindow() > >>> win.connect("delete-event", Gtk.main_quit) > >>> win.show_all() > >>> Gtk.main() > >>> ######################### > >>> > >>> I know this is related to interactive mode, but running from console > >>> >>> python myapp.py > >>> reproduces the problem > >>> > >>> Why hasattr(sys, 'ps1') is False? if I am running it from console? how > >>> do I change this? > >>> > >>> > >>> Thanks > >>> Federico > >>> > >>> P.S. Does anybody had the time to check my PR for multi-figure-manager? > >>> https://github.com/matplotlib/matplotlib/pull/2465 > >>> > >>> -- > >>> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > >>> > >>> -- Antonio Alducin -- > >>> > >>> > >>> > ------------------------------------------------------------------------------ > >>> October Webinars: Code for Performance > >>> Free Intel webinars can help you accelerate application performance. > >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the > most > >>> from > >>> the latest Intel processors and coprocessors. See abstracts and > register > > >>> > >>> > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > >>> _______________________________________________ > >>> Matplotlib-devel mailing list > >>> Mat...@li... > >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > >> > >> > >> > >> > >> -- > >> Thomas A Caswell > >> PhD Candidate University of Chicago > >> Nagel and Gardel labs > >> tca...@uc... > >> jfi.uchicago.edu/~tcaswell > >> o: 773.702.7204 > > > > > > > > -- > > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > > > -- Antonio Alducin -- > > > > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- > -- Thomas A Caswell PhD Candidate University of Chicago Nagel and Gardel labs tca...@uc... jfi.uchicago.edu/~tcaswell o: 773.702.7204 |
From: Eric F. <ef...@ha...> - 2013-10-11 17:32:10
|
On 2013/10/11 7:12 AM, Federico Ariza wrote: > I am not embedding, just launching, as the example shows. No, your example shows that you *are* embedding. You are running your own Gtk.main(). That's embedding. |
From: Federico A. <ari...@gm...> - 2013-10-11 17:37:15
|
Ok, for me embedding is more of using the canvas directly and putting inside my own window. But OK, i give you that. In that case, if I have standalone funcion (or class) that can be run alone something like do_my_plots().... that if run with python myplots.py will display the plots. How can I add the do_my_plots call to my Gk3 app? and not having to worry that closing the plot windows will close my gtk3 app? Federico On Fri, Oct 11, 2013 at 1:32 PM, Eric Firing <ef...@ha...> wrote: > On 2013/10/11 7:12 AM, Federico Ariza wrote: >> I am not embedding, just launching, as the example shows. > > No, your example shows that you *are* embedding. You are running your > own Gtk.main(). That's embedding. > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
From: Eric F. <ef...@ha...> - 2013-10-11 17:59:26
|
On 2013/10/11 7:36 AM, Federico Ariza wrote: > Ok, > for me embedding is more of using the canvas directly and putting > inside my own window. > But OK, i give you that. > > In that case, > if I have standalone funcion (or class) that can be run alone something like > do_my_plots().... that if run with python myplots.py will display the plots. > > How can I add the do_my_plots call to my Gk3 app? and not having to > worry that closing the plot windows will close my gtk3 app? I think the choices are to rewrite do_my_plots to be consistent with your embedding, or to run it in a separate process. For the former option, the key is to keep pyplot out of everything except a top layer which is used when calling via script or in a pyplot environment (e.g. ipython), but which is not used in your gtk3 app. As an example (sorry it is rather long and complex) see http://currents.soest.hawaii.edu/hg/pycurrents/file/43a9236c62ff/plot/txyselect.py. Note that pyplot is not even imported except inside a function that is used to demonstrate the functionality in script mode. Therefore all the functionality is accessible when embedding by importing the module, so long as one does not call that one highest-level function. To embed, one simply includes the contents of that function but without the pyplot parts. Eric > > Federico > > On Fri, Oct 11, 2013 at 1:32 PM, Eric Firing <ef...@ha...> wrote: >> On 2013/10/11 7:12 AM, Federico Ariza wrote: >>> I am not embedding, just launching, as the example shows. >> >> No, your example shows that you *are* embedding. You are running your >> own Gtk.main(). That's embedding. >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from >> the latest Intel processors and coprocessors. See abstracts and register > >> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > |
From: Federico A. <ari...@gm...> - 2013-10-11 18:36:12
|
@Eric But this imposses alot of restrictions? I want to have the GUI backend with the toolbar and everything. If I do it like you propose, I have to create the figures on the side when calling from a ipython session. and when calling from my gtk app, I have to create by hand everything even the toolbars etc... @Tom, I agree that the problem is within the figure manager. That is why I asked about the "unbalanced" ways to call Gtk.main and Gtk.main_quit I was checking https://github.com/matplotlib/matplotlib/pull/2503 but I think the solution proposed there does not help me. As you know I am trying to get the multi-figure-manager accepted or at least reviewed, At the end, if the only way to use a nice GUI backend is without calling it from other GUI, it does not help to have a nice GUI backend, you will have to redoit anyway. Federico On Fri, Oct 11, 2013 at 1:59 PM, Eric Firing <ef...@ha...> wrote: > On 2013/10/11 7:36 AM, Federico Ariza wrote: >> >> Ok, >> for me embedding is more of using the canvas directly and putting >> inside my own window. >> But OK, i give you that. >> >> In that case, >> if I have standalone funcion (or class) that can be run alone something >> like >> do_my_plots().... that if run with python myplots.py will display the >> plots. >> >> How can I add the do_my_plots call to my Gk3 app? and not having to >> worry that closing the plot windows will close my gtk3 app? > > > I think the choices are to rewrite do_my_plots to be consistent with your > embedding, or to run it in a separate process. For the former option, the > key is to keep pyplot out of everything except a top layer which is used > when calling via script or in a pyplot environment (e.g. ipython), but which > is not used in your gtk3 app. As an example (sorry it is rather long and > complex) see > http://currents.soest.hawaii.edu/hg/pycurrents/file/43a9236c62ff/plot/txyselect.py. > Note that pyplot is not even imported except inside a function that is used > to demonstrate the functionality in script mode. Therefore all the > functionality is accessible when embedding by importing the module, so long > as one does not call that one highest-level function. To embed, one simply > includes the contents of that function but without the pyplot parts. > > Eric > > >> >> Federico >> >> On Fri, Oct 11, 2013 at 1:32 PM, Eric Firing <ef...@ha...> wrote: >>> >>> On 2013/10/11 7:12 AM, Federico Ariza wrote: >>>> >>>> I am not embedding, just launching, as the example shows. >>> >>> >>> No, your example shows that you *are* embedding. You are running your >>> own Gtk.main(). That's embedding. >>> >>> >>> ------------------------------------------------------------------------------ >>> October Webinars: Code for Performance >>> Free Intel webinars can help you accelerate application performance. >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >>> from >>> the latest Intel processors and coprocessors. See abstracts and register >>> > >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Matplotlib-devel mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> >> >> >> > -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
From: Thomas A C. <tca...@uc...> - 2013-10-11 19:28:49
|
Please keep all emails in-band I was commenting that the issue you are having with getting easy-to-use pre-built figures in a non-interactive program without dragging pyplot in is the same as what I think the root of 2503 is and the re-factor I proposed to make your life easier would also help that case (I think). The gui backends were (as I understand it, someone please correct me if I am wrong) built to play nice with ipython to put together a MATLAB-like interface. The fact that you can then embed the gui-framework dependent bits of matplotlib in other gui applications is a nice side-effect, but not one of the initial design goals. This is why the `figure_manager` code is (too-)tightly coupled to _pylab_helpers. See the examples at http://matplotlib.org/examples/user_interfaces/ making a window with a canvas + tool bar is pretty easy. A quick and dirty solution might be to just monkey patch the figure_manager.destroy function when your app starts up to remove the check that shuts down the main loop. Tom On Fri, Oct 11, 2013 at 1:40 PM, Federico Ariza <ari...@gm...>wrote: > Sorry I don't get it. > Are you suggesting to explain this little predicament in the PR to > give another point of view? or > You want me to check the PR and try to use the solutions proposed there? > > Federico > > On Fri, Oct 11, 2013 at 1:32 PM, Thomas A Caswell <tca...@uc...> > wrote: > > embedding vs launching is a distinction without a difference, you are > > integrating matplotlib with your own gui application. > > > > That said, it would be nice to re-factor the figure_manager classes so > they > > they make no reference to `Gcf` or anything associated with pylab and > could > > be easily re-used. > > > > I think that would also help with the issues in > > https://github.com/matplotlib/matplotlib/pull/2503 > > > > Tom > > > > > > On Fri, Oct 11, 2013 at 12:14 PM, Federico Ariza < > ari...@gm...> > > wrote: > >> > >> Again > >> > >> In the example the plotting is inside the callback (just for > >> simplicity), but in reality, the plotting is in another class, > >> somewhere else that can be called standalone to produce the plots. > >> > >> Federico > >> > >> On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza > >> <ari...@gm...> wrote: > >> > I am not embedding, just launching, as the example shows. > >> > > >> > Federico > >> > > >> > On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell > >> > <tca...@uc...> wrote: > >> >> If you are embedding matplotlib, do not import `pyplot`. `pyplot` > sets > >> >> up a > >> >> bunch of gui-magic (tm) in the background (as you found in > >> >> `figure_manager`). > >> >> > >> >> Tom > >> >> > >> >> > >> >> On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza > >> >> <ari...@gm...> > >> >> wrote: > >> >>> > >> >>> Hello everybody > >> >>> > >> >>> Working on one GTK3 app, that calls matplotlib to plot some > figures, I > >> >>> found that closing all the figures from matplotlib kills my app > also. > >> >>> The problem.... > >> >>> > >> >>> Gtk.main() is called only if there is no previous invocation, in my > >> >>> case, my Gtk3 app invokes main, so the mainloop won't call it again. > >> >>> > >> >>> #in backend_gtk3.py > >> >>> # > >> >>> class Show(ShowBase): > >> >>> def mainloop(self): > >> >>> if Gtk.main_level() == 0: > >> >>> Gtk.main() > >> >>> > >> >>> But in the "destroy" method of the figure manager calls > Gtk.main_quit > >> >>> everytime that there are no more figures > >> >>> > >> >>> #in backend_gtk3.py inside destroy method of FigureManagerGTK3 > >> >>> # > >> >>> if Gcf.get_num_fig_managers()==0 and \ > >> >>> not matplotlib.is_interactive() and \ > >> >>> Gtk.main_level() >= 1: > >> >>> Gtk.main_quit() > >> >>> > >> >>> > >> >>> So basically we are not calling Gtk.main but we are Gtk.calling > >> >>> main_quit. > >> >>> Isn't it more natural to call Gtk.main the same amount of times that > >> >>> we are going to call Gtk.main_quit? > >> >>> > >> >>> Adding matplotlib.rcParams['interactive'] = True doesn't help > >> >>> > >> >>> Here is my little testing code > >> >>> > >> >>> ############################## > >> >>> #file myapp.py > >> >>> > >> >>> import matplotlib > >> >>> matplotlib.rcParams['interactive'] = True > >> >>> matplotlib.use('GTK3AGG') > >> >>> import matplotlib.pyplot as plt > >> >>> > >> >>> from gi.repository import Gtk > >> >>> > >> >>> class MyWindow(Gtk.Window): > >> >>> > >> >>> def __init__(self): > >> >>> Gtk.Window.__init__(self, title="Hello World") > >> >>> > >> >>> self.button = Gtk.Button(label="Click Here") > >> >>> self.button.connect("clicked", self.on_button_clicked) > >> >>> self.add(self.button) > >> >>> > >> >>> def on_button_clicked(self, widget): > >> >>> fig = plt.figure() > >> >>> ax = fig.add_subplot(111) > >> >>> ax.plot([1,2,3]) > >> >>> plt.show() > >> >>> > >> >>> win = MyWindow() > >> >>> win.connect("delete-event", Gtk.main_quit) > >> >>> win.show_all() > >> >>> Gtk.main() > >> >>> ######################### > >> >>> > >> >>> I know this is related to interactive mode, but running from console > >> >>> >>> python myapp.py > >> >>> reproduces the problem > >> >>> > >> >>> Why hasattr(sys, 'ps1') is False? if I am running it from console? > how > >> >>> do I change this? > >> >>> > >> >>> > >> >>> Thanks > >> >>> Federico > >> >>> > >> >>> P.S. Does anybody had the time to check my PR for > >> >>> multi-figure-manager? > >> >>> https://github.com/matplotlib/matplotlib/pull/2465 > >> >>> > >> >>> -- > >> >>> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > >> >>> > >> >>> -- Antonio Alducin -- > >> >>> > >> >>> > >> >>> > >> >>> > ------------------------------------------------------------------------------ > >> >>> October Webinars: Code for Performance > >> >>> Free Intel webinars can help you accelerate application performance. > >> >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the > >> >>> most > >> >>> from > >> >>> the latest Intel processors and coprocessors. See abstracts and > >> >>> register > > >> >>> > >> >>> > >> >>> > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > >> >>> _______________________________________________ > >> >>> Matplotlib-devel mailing list > >> >>> Mat...@li... > >> >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > >> >> > >> >> > >> >> > >> >> > >> >> -- > >> >> Thomas A Caswell > >> >> PhD Candidate University of Chicago > >> >> Nagel and Gardel labs > >> >> tca...@uc... > >> >> jfi.uchicago.edu/~tcaswell > >> >> o: 773.702.7204 > >> > > >> > > >> > > >> > -- > >> > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > >> > > >> > -- Antonio Alducin -- > >> > >> > >> > >> -- > >> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > >> > >> -- Antonio Alducin -- > > > > > > > > > > -- > > Thomas A Caswell > > PhD Candidate University of Chicago > > Nagel and Gardel labs > > tca...@uc... > > jfi.uchicago.edu/~tcaswell > > o: 773.702.7204 > > > > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- > -- Thomas A Caswell PhD Candidate University of Chicago Nagel and Gardel labs tca...@uc... jfi.uchicago.edu/~tcaswell o: 773.702.7204 |
From: Federico A. <ari...@gm...> - 2013-10-11 20:15:52
|
Sorry, the replay-all is not my default. In that case it is easier for me to monkey patch just the mainloop to invoke Gtk.main everytime. But again, even if we are talking about interactive (ipython), why is it unbalanced? I mean calls Gtk.main vs Gtk.main_quit? Federico On Fri, Oct 11, 2013 at 3:28 PM, Thomas A Caswell <tca...@uc...> wrote: > Please keep all emails in-band > > I was commenting that the issue you are having with getting easy-to-use > pre-built figures in a non-interactive program without dragging pyplot in is > the same as what I think the root of 2503 is and the re-factor I proposed to > make your life easier would also help that case (I think). > > The gui backends were (as I understand it, someone please correct me if I am > wrong) built to play nice with ipython to put together a MATLAB-like > interface. The fact that you can then embed the gui-framework dependent > bits of matplotlib in other gui applications is a nice side-effect, but not > one of the initial design goals. This is why the `figure_manager` code is > (too-)tightly coupled to _pylab_helpers. > > See the examples at http://matplotlib.org/examples/user_interfaces/ making > a window with a canvas + tool bar is pretty easy. > > A quick and dirty solution might be to just monkey patch the > figure_manager.destroy function when your app starts up to remove the check > that shuts down the main loop. > > Tom > > > On Fri, Oct 11, 2013 at 1:40 PM, Federico Ariza <ari...@gm...> > wrote: >> >> Sorry I don't get it. >> Are you suggesting to explain this little predicament in the PR to >> give another point of view? or >> You want me to check the PR and try to use the solutions proposed there? >> >> Federico >> >> On Fri, Oct 11, 2013 at 1:32 PM, Thomas A Caswell <tca...@uc...> >> wrote: >> > embedding vs launching is a distinction without a difference, you are >> > integrating matplotlib with your own gui application. >> > >> > That said, it would be nice to re-factor the figure_manager classes so >> > they >> > they make no reference to `Gcf` or anything associated with pylab and >> > could >> > be easily re-used. >> > >> > I think that would also help with the issues in >> > https://github.com/matplotlib/matplotlib/pull/2503 >> > >> > Tom >> > >> > >> > On Fri, Oct 11, 2013 at 12:14 PM, Federico Ariza >> > <ari...@gm...> >> > wrote: >> >> >> >> Again >> >> >> >> In the example the plotting is inside the callback (just for >> >> simplicity), but in reality, the plotting is in another class, >> >> somewhere else that can be called standalone to produce the plots. >> >> >> >> Federico >> >> >> >> On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza >> >> <ari...@gm...> wrote: >> >> > I am not embedding, just launching, as the example shows. >> >> > >> >> > Federico >> >> > >> >> > On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell >> >> > <tca...@uc...> wrote: >> >> >> If you are embedding matplotlib, do not import `pyplot`. `pyplot` >> >> >> sets >> >> >> up a >> >> >> bunch of gui-magic (tm) in the background (as you found in >> >> >> `figure_manager`). >> >> >> >> >> >> Tom >> >> >> >> >> >> >> >> >> On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza >> >> >> <ari...@gm...> >> >> >> wrote: >> >> >>> >> >> >>> Hello everybody >> >> >>> >> >> >>> Working on one GTK3 app, that calls matplotlib to plot some >> >> >>> figures, I >> >> >>> found that closing all the figures from matplotlib kills my app >> >> >>> also. >> >> >>> The problem.... >> >> >>> >> >> >>> Gtk.main() is called only if there is no previous invocation, in my >> >> >>> case, my Gtk3 app invokes main, so the mainloop won't call it >> >> >>> again. >> >> >>> >> >> >>> #in backend_gtk3.py >> >> >>> # >> >> >>> class Show(ShowBase): >> >> >>> def mainloop(self): >> >> >>> if Gtk.main_level() == 0: >> >> >>> Gtk.main() >> >> >>> >> >> >>> But in the "destroy" method of the figure manager calls >> >> >>> Gtk.main_quit >> >> >>> everytime that there are no more figures >> >> >>> >> >> >>> #in backend_gtk3.py inside destroy method of FigureManagerGTK3 >> >> >>> # >> >> >>> if Gcf.get_num_fig_managers()==0 and \ >> >> >>> not matplotlib.is_interactive() and \ >> >> >>> Gtk.main_level() >= 1: >> >> >>> Gtk.main_quit() >> >> >>> >> >> >>> >> >> >>> So basically we are not calling Gtk.main but we are Gtk.calling >> >> >>> main_quit. >> >> >>> Isn't it more natural to call Gtk.main the same amount of times >> >> >>> that >> >> >>> we are going to call Gtk.main_quit? >> >> >>> >> >> >>> Adding matplotlib.rcParams['interactive'] = True doesn't help >> >> >>> >> >> >>> Here is my little testing code >> >> >>> >> >> >>> ############################## >> >> >>> #file myapp.py >> >> >>> >> >> >>> import matplotlib >> >> >>> matplotlib.rcParams['interactive'] = True >> >> >>> matplotlib.use('GTK3AGG') >> >> >>> import matplotlib.pyplot as plt >> >> >>> >> >> >>> from gi.repository import Gtk >> >> >>> >> >> >>> class MyWindow(Gtk.Window): >> >> >>> >> >> >>> def __init__(self): >> >> >>> Gtk.Window.__init__(self, title="Hello World") >> >> >>> >> >> >>> self.button = Gtk.Button(label="Click Here") >> >> >>> self.button.connect("clicked", self.on_button_clicked) >> >> >>> self.add(self.button) >> >> >>> >> >> >>> def on_button_clicked(self, widget): >> >> >>> fig = plt.figure() >> >> >>> ax = fig.add_subplot(111) >> >> >>> ax.plot([1,2,3]) >> >> >>> plt.show() >> >> >>> >> >> >>> win = MyWindow() >> >> >>> win.connect("delete-event", Gtk.main_quit) >> >> >>> win.show_all() >> >> >>> Gtk.main() >> >> >>> ######################### >> >> >>> >> >> >>> I know this is related to interactive mode, but running from >> >> >>> console >> >> >>> >>> python myapp.py >> >> >>> reproduces the problem >> >> >>> >> >> >>> Why hasattr(sys, 'ps1') is False? if I am running it from console? >> >> >>> how >> >> >>> do I change this? >> >> >>> >> >> >>> >> >> >>> Thanks >> >> >>> Federico >> >> >>> >> >> >>> P.S. Does anybody had the time to check my PR for >> >> >>> multi-figure-manager? >> >> >>> https://github.com/matplotlib/matplotlib/pull/2465 >> >> >>> >> >> >>> -- >> >> >>> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >> >> >>> >> >> >>> -- Antonio Alducin -- >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> ------------------------------------------------------------------------------ >> >> >>> October Webinars: Code for Performance >> >> >>> Free Intel webinars can help you accelerate application >> >> >>> performance. >> >> >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the >> >> >>> most >> >> >>> from >> >> >>> the latest Intel processors and coprocessors. See abstracts and >> >> >>> register > >> >> >>> >> >> >>> >> >> >>> >> >> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >> >> >>> _______________________________________________ >> >> >>> Matplotlib-devel mailing list >> >> >>> Mat...@li... >> >> >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> Thomas A Caswell >> >> >> PhD Candidate University of Chicago >> >> >> Nagel and Gardel labs >> >> >> tca...@uc... >> >> >> jfi.uchicago.edu/~tcaswell >> >> >> o: 773.702.7204 >> >> > >> >> > >> >> > >> >> > -- >> >> > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >> >> > >> >> > -- Antonio Alducin -- >> >> >> >> >> >> >> >> -- >> >> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >> >> >> >> -- Antonio Alducin -- >> > >> > >> > >> > >> > -- >> > Thomas A Caswell >> > PhD Candidate University of Chicago >> > Nagel and Gardel labs >> > tca...@uc... >> > jfi.uchicago.edu/~tcaswell >> > o: 773.702.7204 >> >> >> >> -- >> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >> >> -- Antonio Alducin -- > > > > > -- > Thomas A Caswell > PhD Candidate University of Chicago > Nagel and Gardel labs > tca...@uc... > jfi.uchicago.edu/~tcaswell > o: 773.702.7204 -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
From: Federico A. <ari...@gm...> - 2013-10-11 20:49:37
|
Looking through the code I realize that in interactive mode (ipython) there is no call to show() by default. And if you call it, it does not call mailoop because is_interactive==Tr ue So why is there the restriction to call only once Gtk.main in mailoop? if it is not called anyway Why not make that restriction to call Gtk.main in mainloop dependant on is_interactive? as the call Gtk.main_quit is in the destroy method Federico On Fri, Oct 11, 2013 at 4:15 PM, Federico Ariza <ari...@gm...> wrote: > Sorry, the replay-all is not my default. > > In that case it is easier for me to monkey patch just the mainloop to > invoke Gtk.main everytime. > > But again, even if we are talking about interactive (ipython), why is > it unbalanced? > I mean calls Gtk.main vs Gtk.main_quit? > > Federico > > > > On Fri, Oct 11, 2013 at 3:28 PM, Thomas A Caswell <tca...@uc...> wrote: >> Please keep all emails in-band >> >> I was commenting that the issue you are having with getting easy-to-use >> pre-built figures in a non-interactive program without dragging pyplot in is >> the same as what I think the root of 2503 is and the re-factor I proposed to >> make your life easier would also help that case (I think). >> >> The gui backends were (as I understand it, someone please correct me if I am >> wrong) built to play nice with ipython to put together a MATLAB-like >> interface. The fact that you can then embed the gui-framework dependent >> bits of matplotlib in other gui applications is a nice side-effect, but not >> one of the initial design goals. This is why the `figure_manager` code is >> (too-)tightly coupled to _pylab_helpers. >> >> See the examples at http://matplotlib.org/examples/user_interfaces/ making >> a window with a canvas + tool bar is pretty easy. >> >> A quick and dirty solution might be to just monkey patch the >> figure_manager.destroy function when your app starts up to remove the check >> that shuts down the main loop. >> >> Tom >> >> >> On Fri, Oct 11, 2013 at 1:40 PM, Federico Ariza <ari...@gm...> >> wrote: >>> >>> Sorry I don't get it. >>> Are you suggesting to explain this little predicament in the PR to >>> give another point of view? or >>> You want me to check the PR and try to use the solutions proposed there? >>> >>> Federico >>> >>> On Fri, Oct 11, 2013 at 1:32 PM, Thomas A Caswell <tca...@uc...> >>> wrote: >>> > embedding vs launching is a distinction without a difference, you are >>> > integrating matplotlib with your own gui application. >>> > >>> > That said, it would be nice to re-factor the figure_manager classes so >>> > they >>> > they make no reference to `Gcf` or anything associated with pylab and >>> > could >>> > be easily re-used. >>> > >>> > I think that would also help with the issues in >>> > https://github.com/matplotlib/matplotlib/pull/2503 >>> > >>> > Tom >>> > >>> > >>> > On Fri, Oct 11, 2013 at 12:14 PM, Federico Ariza >>> > <ari...@gm...> >>> > wrote: >>> >> >>> >> Again >>> >> >>> >> In the example the plotting is inside the callback (just for >>> >> simplicity), but in reality, the plotting is in another class, >>> >> somewhere else that can be called standalone to produce the plots. >>> >> >>> >> Federico >>> >> >>> >> On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza >>> >> <ari...@gm...> wrote: >>> >> > I am not embedding, just launching, as the example shows. >>> >> > >>> >> > Federico >>> >> > >>> >> > On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell >>> >> > <tca...@uc...> wrote: >>> >> >> If you are embedding matplotlib, do not import `pyplot`. `pyplot` >>> >> >> sets >>> >> >> up a >>> >> >> bunch of gui-magic (tm) in the background (as you found in >>> >> >> `figure_manager`). >>> >> >> >>> >> >> Tom >>> >> >> >>> >> >> >>> >> >> On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza >>> >> >> <ari...@gm...> >>> >> >> wrote: >>> >> >>> >>> >> >>> Hello everybody >>> >> >>> >>> >> >>> Working on one GTK3 app, that calls matplotlib to plot some >>> >> >>> figures, I >>> >> >>> found that closing all the figures from matplotlib kills my app >>> >> >>> also. >>> >> >>> The problem.... >>> >> >>> >>> >> >>> Gtk.main() is called only if there is no previous invocation, in my >>> >> >>> case, my Gtk3 app invokes main, so the mainloop won't call it >>> >> >>> again. >>> >> >>> >>> >> >>> #in backend_gtk3.py >>> >> >>> # >>> >> >>> class Show(ShowBase): >>> >> >>> def mainloop(self): >>> >> >>> if Gtk.main_level() == 0: >>> >> >>> Gtk.main() >>> >> >>> >>> >> >>> But in the "destroy" method of the figure manager calls >>> >> >>> Gtk.main_quit >>> >> >>> everytime that there are no more figures >>> >> >>> >>> >> >>> #in backend_gtk3.py inside destroy method of FigureManagerGTK3 >>> >> >>> # >>> >> >>> if Gcf.get_num_fig_managers()==0 and \ >>> >> >>> not matplotlib.is_interactive() and \ >>> >> >>> Gtk.main_level() >= 1: >>> >> >>> Gtk.main_quit() >>> >> >>> >>> >> >>> >>> >> >>> So basically we are not calling Gtk.main but we are Gtk.calling >>> >> >>> main_quit. >>> >> >>> Isn't it more natural to call Gtk.main the same amount of times >>> >> >>> that >>> >> >>> we are going to call Gtk.main_quit? >>> >> >>> >>> >> >>> Adding matplotlib.rcParams['interactive'] = True doesn't help >>> >> >>> >>> >> >>> Here is my little testing code >>> >> >>> >>> >> >>> ############################## >>> >> >>> #file myapp.py >>> >> >>> >>> >> >>> import matplotlib >>> >> >>> matplotlib.rcParams['interactive'] = True >>> >> >>> matplotlib.use('GTK3AGG') >>> >> >>> import matplotlib.pyplot as plt >>> >> >>> >>> >> >>> from gi.repository import Gtk >>> >> >>> >>> >> >>> class MyWindow(Gtk.Window): >>> >> >>> >>> >> >>> def __init__(self): >>> >> >>> Gtk.Window.__init__(self, title="Hello World") >>> >> >>> >>> >> >>> self.button = Gtk.Button(label="Click Here") >>> >> >>> self.button.connect("clicked", self.on_button_clicked) >>> >> >>> self.add(self.button) >>> >> >>> >>> >> >>> def on_button_clicked(self, widget): >>> >> >>> fig = plt.figure() >>> >> >>> ax = fig.add_subplot(111) >>> >> >>> ax.plot([1,2,3]) >>> >> >>> plt.show() >>> >> >>> >>> >> >>> win = MyWindow() >>> >> >>> win.connect("delete-event", Gtk.main_quit) >>> >> >>> win.show_all() >>> >> >>> Gtk.main() >>> >> >>> ######################### >>> >> >>> >>> >> >>> I know this is related to interactive mode, but running from >>> >> >>> console >>> >> >>> >>> python myapp.py >>> >> >>> reproduces the problem >>> >> >>> >>> >> >>> Why hasattr(sys, 'ps1') is False? if I am running it from console? >>> >> >>> how >>> >> >>> do I change this? >>> >> >>> >>> >> >>> >>> >> >>> Thanks >>> >> >>> Federico >>> >> >>> >>> >> >>> P.S. Does anybody had the time to check my PR for >>> >> >>> multi-figure-manager? >>> >> >>> https://github.com/matplotlib/matplotlib/pull/2465 >>> >> >>> >>> >> >>> -- >>> >> >>> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >>> >> >>> >>> >> >>> -- Antonio Alducin -- >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> ------------------------------------------------------------------------------ >>> >> >>> October Webinars: Code for Performance >>> >> >>> Free Intel webinars can help you accelerate application >>> >> >>> performance. >>> >> >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the >>> >> >>> most >>> >> >>> from >>> >> >>> the latest Intel processors and coprocessors. See abstracts and >>> >> >>> register > >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >>> >> >>> _______________________________________________ >>> >> >>> Matplotlib-devel mailing list >>> >> >>> Mat...@li... >>> >> >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> -- >>> >> >> Thomas A Caswell >>> >> >> PhD Candidate University of Chicago >>> >> >> Nagel and Gardel labs >>> >> >> tca...@uc... >>> >> >> jfi.uchicago.edu/~tcaswell >>> >> >> o: 773.702.7204 >>> >> > >>> >> > >>> >> > >>> >> > -- >>> >> > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >>> >> > >>> >> > -- Antonio Alducin -- >>> >> >>> >> >>> >> >>> >> -- >>> >> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >>> >> >>> >> -- Antonio Alducin -- >>> > >>> > >>> > >>> > >>> > -- >>> > Thomas A Caswell >>> > PhD Candidate University of Chicago >>> > Nagel and Gardel labs >>> > tca...@uc... >>> > jfi.uchicago.edu/~tcaswell >>> > o: 773.702.7204 >>> >>> >>> >>> -- >>> Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? >>> >>> -- Antonio Alducin -- >> >> >> >> >> -- >> Thomas A Caswell >> PhD Candidate University of Chicago >> Nagel and Gardel labs >> tca...@uc... >> jfi.uchicago.edu/~tcaswell >> o: 773.702.7204 > > > > -- > Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? > > -- Antonio Alducin -- -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |