On Thu, Mar 18, 2010 at 7:01 AM, Philippe Crave <philippe.crave@gmail.com> wrote:
Hello,

the following will display a figure with a plot. the figure will embed
the classic toolbar.

import matplotlib.pyplot as plt
import numpy as np
x=np.arange(0, 1, 0.1)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x)
plt.show()

from there, is it possible to add new buttons to the toolbar ? with
new fonction ?
or do I have to embed everythong in wxPython, GTK or others ?

thank you,
Philippe

Hi Pierre Raybaut a nice extension for what you are asking. You will need to use Qt4Agg backend to use it. The code is at http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/qt4_editor/

He doesn't seem like planning to add more onto this extension (http://code.google.com/p/spyderlib/issues/detail?id=136)

This said, his code is easy to read and you should easily be able to extend it according to your need.


--
Gökhan