<div>Thank You Tom,<br></div><div>It seems that there is in fact quite a lot of changes needed to get this working. First of all I will try to fix that "pylab" issue and then look at the input hooks, but I am not sure if this is still valid for normal python (not IPython - see below). The backend is GTK3Agg - confirmed. <br></div><div><br></div><div>I'm not using IPython, just normal python 2.7.14, and this was not changed, so it was only matplotlib and pygtk version change. The old code was creating a "waveform" window when requested (with the code presented before) and for input I was using readline module, the application has set of predefined commands that it executes. Now I am a bit surprised that it was working right from the begging.... (If someone want to see the code then I can post it here)<br></div><div><br></div><div>By the way I thought  that having a responsive plot window (in fact only zooming/moving is important) in a command line based application is a common task, but it seems that it is not. Is there any example available for gtk+readline (or any other text input module) usage? <br></div><div><br></div><div>Thanks again,<br></div><div>Michael Widlok<br></div><div class="nh_extra"><p>Dnia 28 kwietnia 2018 02:46 Thomas Caswell <tcaswell@gmail.com> napisaƂ(a):<br></p><blockquote class="nh_quote" style="border-left: 2px solid #999; padding-left: 8px; margin: 0;"><div id="gwp5aa1c412"><div id="gwp5aa1c412h"><div class="gwp5aa1c412b" data-message-body="true"><div dir="ltr"><div>Michael,<br></div><div><br></div><div>If you are doing custom embedding I suggest staying away from `pyplot` altogether, it maintains global state you may not want, see for example <a href="https://matplotlib.org/gallery/user_interfaces/embedding_in_gtk3_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-gtk3-sgskip-py" target="_blank" nh-safe-redirect="" data-saferedirecturl="https://zasobygwp.pl/redirect?sig=44d3d067d4d0c11d4d4b283c2d3a37b3c4bfdd2a1ccfc58d61b49e8278e2e407&url=aHR0cHM6Ly9tYXRwbG90bGliLm9yZy9nYWxsZXJ5L3VzZXJfaW50ZXJmYWNlcy9lbWJlZGRpbmdfaW5fZ3RrM19zZ3NraXAuaHRtbCNzcGh4LWdsci1nYWxsZXJ5LXVzZXItaW50ZXJmYWNlcy1lbWJlZGRpbmctaW4tZ3RrMy1zZ3NraXAtcHk=&platform=desktop&brand=o2">https://matplotlib.org/gallery/user_interfaces/embedding_in_gtk3_sgskip.html#sphx-glr-gallery-user-interfaces-embedding-in-gtk3-sgskip-py</a> . <br></div><div><br></div><div>For the long answer to your question, see <a href="https://github.com/matplotlib/matplotlib/pull/4779" target="_blank" nh-safe-redirect="" data-saferedirecturl="https://zasobygwp.pl/redirect?sig=5c1e9e9cf40068bbdf6614565339a29e79fcf8d31cab4df59cb7853262d7fbf6&url=aHR0cHM6Ly9naXRodWIuY29tL21hdHBsb3RsaWIvbWF0cGxvdGxpYi9wdWxsLzQ3Nzk=&platform=desktop&brand=o2">https://github.com/matplotlib/matplotlib/pull/4779</a> (which I really need to finish and get merged).  In short, to have both an interactive prompt and a window you need to have an 'input hook' installed to time-share between the GUI event loop an the prompt event loop.  It sounds like you change a bunch of things at once (gtk2 -> gtk3 + matplotlib version bumps),  did you also change IPython versions?  If so, you will need to use their input hook mechanism explicitly (`%matplotlib gtk3` should do the trick) as they moved from readline -> ptprompt so the input hooks the GUI libraries ship no longer work. <br></div><div><br></div><div>It may also be worth checking the value of `mpl.get_backend()` to make sure pyplot as not defaulted to another GUI framework (ex Qt5) and you have 2 GUI frameworks in the same process conflicting with each other!<br></div><div><br></div><div>Hope that helps!<br></div><div><br></div><div>Tom<br></div></div><div><br></div><div class="gwp5aa1c412_gmail_quote"><div dir="ltr">On Sun, Apr 22, 2018 at 4:50 PM michalwd1979 <<a nh-compose-link="" href="mailto:michalwd1979@o2.pl" target="_blank"></a><a nh-compose-link="" href="mailto:michalwd1979@o2.pl">michalwd1979@o2.pl</a>> wrote:<br></div><blockquote is-minimized="" class="gwp5aa1c412_gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Dear Members,<br></div><div>Recently I upgraded to from matplotlib 1.4.3 + gtk2 to matplotlib 2.2.2 + gtk3 and I have a problems with porting my old code.<br></div><div>I'm using matplotlib in Gtk window with typical:<br></div><div>win = Gtk.window()<br></div><div>vbox = Gtk.Box(...)<br></div><div>win.add(vbox)<br></div><div>fig = pylab.figure()<br></div><div>canvas = FigureCanvas(fig)<br></div><div>toolbar = NavigationToolbar(canvas, fig)<br></div><div>axis = fig.add_axes(...)<br></div><div>vbox.pack_start(canvas,...)<br></div><div>vbox.pack_start(toolbar,....)<br></div><div>win.show_all()<br></div><div>while(Gtk.events_pending()): Gtk.main_iteration()<br></div><div><br></div><div>After this code I have a valid window on screen however it does not reacts on mouse clicks (zooming etc.) until calling Gtk.main_iteration() in loop or Gtk.main(). I can understand why, however it was working differently with old matplotlib and gtk2 (window was responsive all time). <br></div><div>The rest of my code is a python "Text User Interface" application (controlled by commands typed to terminal), the window is only for showing the results (animated waveform). Now I would like to keep the application as it is, but also to have responsive matplotlib window, without calling Gtk.main(). Is it possible? If yes, then how to do this?<br></div><div><br></div><div>Sorry for the long mail - I have no idea how to describe the problem shortly and all examples I found always have Gtk.main() called so they are in fact full GTK programs. I want a simple text program with matplotlib window as a "result showing" addition only.<br></div><div>Best Regards,<br></div><div>Michael Widlok<br></div></blockquote></div></div></div></div></blockquote></div><div><br></div>