Note that there are some explanatory texts on larger screens.

plurals
  1. POButton does not work in second (nested) figure
    primarykey
    data
    text
    <p>I think I've come across a bug in Matplotlib, though I really hope it's just something simple I'm missing.</p> <p>The code I'm working on has worked well on Ubuntu 11.10, Ubuntu 12.04, and MacOS. Recently I installed Fedora 18 on my machine and I've noticed Matplotlib is having some issues: I have a figure with a button. Click the button, it opens another window which also has some buttons. The buttons in the second window are inactive on my Fedora system. They don't respond to hover (they don't change color), and they don't respond to click.</p> <p>Here's a small piece of code that simulates this issue. This works well on my Ubuntu 12.04, but not on Fedora. It's supposed to work as follows: show a figure with a big button, if you click the button it will show another figure which in turn has button too. If all is well, the second button should respond to hover and print something to the terminal when clicked.</p> <pre><code>import pylab from matplotlib.widgets import Button def draw_button1(event): pylab.figure() a = pylab.axes([0.1, 0.1, 0.8, 0.8]) b = Button(a, 'Button 1') def say_something(event): print "This works." b.on_clicked(say_something) pylab.show() def draw_button2(): pylab.figure() a = pylab.axes([0.1, 0.1, 0.8, 0.8]) b = Button(a, 'Button 2') b.on_clicked(draw_button1) pylab.show() draw_button2() </code></pre> <p>I have no idea what is causing this. I've tried a number of things:</p> <ol> <li><p>I've installed Matplitlib 1.2.0, 1.2.1 from yum repository, and the latest 1.3.0rc2 which I built from source. They all do the same. I've also installed all relevant dependencies of Matplotlib, even those optional.</p></li> <li><p>I've tried to run my piece of code remotely on Ubuntu 12.04 from my Fedora machine.. Maybe there's a problem with how X renders those windows? Still works on my Ubuntu, rendering on my Fedora.</p></li> <li><p>Furious googling on this issue which hasn't really helped. People suggest using <code>pylab.ion()</code> and <code>pylab.ioff()</code> for interactive plots, but that hasn't helped either.</p></li> </ol> <p>If it helps in any way, here's my Matplotlib build:</p> <pre><code>BUILDING MATPLOTLIB matplotlib: yes [1.3.0rc2] python: yes [2.7.3 (default, Aug 9 2012, 17:23:57) [GCC 4.7.1 20120720 (Red Hat 4.7.1-5)]] platform: yes [linux2] REQUIRED DEPENDENCIES AND EXTENSIONS numpy: yes [version 1.7.1] dateutil: yes [using dateutil version 1.5] tornado: yes [using tornado version 3.1] pyparsing: yes [using pyparsing version 1.5.6] pycxx: yes [Couldn't import. Using local copy.] libagg: yes [pkg-config information for 'libagg' could not be found. Using local copy.] freetype: yes [version 15.0.9] png: yes [version 1.5.13] OPTIONAL SUBPACKAGES sample_data: yes [installing] toolkits: yes [installing] tests: yes [using nose version 1.3.0] OPTIONAL BACKEND EXTENSIONS macosx: no [Mac OS-X only] qt4agg: no [PyQt4 not found] gtk3agg: yes [version 3.4.6] gtk3cairo: yes [version 3.4.6] gtkagg: yes [Gtk: 2.24.18 pygtk: 2.24.0] tkagg: no [The C/C++ header for Tk (tk.h) could not be found. You may need to install the development package.] wxagg: no [requires wxPython] gtk: yes [Gtk: 2.24.18 pygtk: 2.24.0] agg: yes [installing] cairo: yes [version 1.8.10] windowing: no [Microsoft Windows only] OPTIONAL LATEX DEPENDENCIES dvipng: yes [version 1.14] ghostscript: yes [version 9.06] latex: no pdftops: yes [version 0.20.2] </code></pre> <p>Thanks very much in advance! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload