Status: Open (View Workflow)
6.06/00, 5.34/34, master
On Mac OS X 10.11.2
Using python 2.7.11 [Installed from macports]
Using root 5 and root 6 (Exact versions listed above) [installed from macports]
Using matplotlib version 1.5.0 [installed from pypi using pip]
Summary: When ROOT and matplotlib's pyplot are used in a shared python session, the GUI features of ROOT's canvas window are broken.
This is best explained using an example: In a (fresh) python session executing
will create a new canvas and open its window. This window has a menu bar (Items: File, Edit, View, Options, Tools), the user can click the menu items and drop-down menus open.
Executing the following code
will also open a canvas, however, the menu items remain unresponsive. Clicking on a menu item does not result in a drop-down menu being shown.
- The order of the imports does not matter. If the canvas is created prior to import pyplot, it will remain responsive up to the point when pyplot is imported.
- The plotting functionality of the canvas remains functional: plotted histograms show, the axes can be changed (using the accessor functions rather than the GUI).
- Sometimes, the down-down menu will show for a split-second when closing the python interpreter.
I did some further investigation, the issue seems to be related to conflicts between the UI backends / handlers of matplotlib and ROOT.
Important: The issue can be worked-around by changing the backend of matplotlib:
will result in a properly working ROOT canvas, however, we are now stuck with the non-interactive, most basic matplotlib backend.