What backends are working with python 3

Hi,
After a while away from matplotlib I am back working on some old code. I
decided to switch to python 3 (bad idea?) and I am having problems with
backends. I used to use GTKAgg, it worked ok, but it doesn't seem to work
with python 3?
1- What are my choices running python 3 and matplotlib from source (I
started following the master branch to avoid some bugs in the past, and kept
using it since)? I did look in the docs and searched the lists, but I
couldn't find a clear answer.
2- Is it discouraged to use matplotlib with python 3?
3- I got the Qt4Agg backend sort of working. It displays my figures ok, but
throws exceptions related to some key events I have set up. See below for
backtrace. unichr() has disappeared in python 3, but somehow the backend is
still using it?

Sorry about the post becoming a bit messy.

Jorge

backtrace:

NameError Traceback (most recent call last)
/home/jscandal/sw/matplotlib/matplotlib/lib/matplotlib/backends/backend_qt4.py
in
keyReleaseEvent(self=<matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg

, event=<PyQt4.QtGui.QKeyEvent object>)

    308
    309 def keyReleaseEvent(self, event):
--> 310 key = self._get_key(event)
        key = undefined
        self._get_key = <bound method FigureCanvasQTAgg._get_key of
<matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg object at 0x7fc124046af8>>
        event = <PyQt4.QtGui.QKeyEvent object at 0x7fc1260cfb88>
    311 if key is None:
    312 return

/home/jscandal/sw/matplotlib/matplotlib/lib/matplotlib/backends/backend_qt4.py
in _get_key(self=<matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg

, event=<PyQt4.QtGui.QKeyEvent object>)

    363 return None
    364
--> 365 key = unichr(event_key)
        key = undefined
        global unichr = undefined
        global event_key = undefined
    366 # qt delivers capitalized letters. fix capitalization
    367 # note that capslock is ignored

NameError: name 'unichr' is not defined

I am using matplotlib with Python 3 and the Qt backend (PyQt4 and PySide) but I did not try to handle key events (just mouse) ...

Armando

···

On 05/06/2014 07:21, Jorge Scandaliaris wrote:

Hi,
After a while away from matplotlib I am back working on some old code. I
decided to switch to python 3 (bad idea?) and I am having problems with
backends. I used to use GTKAgg, it worked ok, but it doesn't seem to work
with python 3?
1- What are my choices running python 3 and matplotlib from source (I
started following the master branch to avoid some bugs in the past, and kept
using it since)? I did look in the docs and searched the lists, but I
couldn't find a clear answer.
2- Is it discouraged to use matplotlib with python 3?

Hi Jorge,

Oops, sorry for first sending it directly to your mail.

Some time ago I did a bit of work on the wx backend to work with wxPython Phoenix.

https://github.com/matplotlib/matplotlib/pull/2803

I haven't had time to look at the last few comments made on that PR.

Just the other day someone contacted me off list and he used it on a project of his with a recent build of Phoenix. He noted small refresh issues which corrected itself by resizing the frame, this probably needs a "self.Refresh" or similar when things get drawn.

Builds for Phoenix are here:
http://wxpython.org/Phoenix/snapshot-builds/

Recent versions of Phoenix (this is still in development) run on Py 2.7, Py 3.3 and Py 3.4 and use the wheel format and can be installed with the following at least on Windows and Mac as far as I know:

pip install -U --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix

Werner