Hello,
I have decided to switch to the QtAgg backend because the Designer
software is very appealing. I succeeded in adding a custom widget
representing the FigureCanvasQTAgg, but when I compile the ui file, I
see that it tries to instantiate it as FigureCanvasQTAgg(Parent) where
Parent is the parent widget, which seems to be the standard format for
instantiating widgets. However, FigureCanvasQTAgg expects a figure as
an argument.
I have seen this tutorial:
http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer
which suggests making a MatplotlibWidget to wrap the Canvas and set
everything up including the parent. I have written a version of this
for Qt4, but this seems like something that should be included in the
Qt4 backends. Any plans on adding this? I'd be happy to contribute.
Attached is my initial version.
Glenn
FigureCanvasQTAggWidget.py (510 Bytes)
figurecanvasqtaggwidgetplugin.py (1.89 KB)
Hi Glenn,
Hello,
I have decided to switch to the QtAgg backend because the Designer
software is very appealing. I succeeded in adding a custom widget
representing the FigureCanvasQTAgg, but when I compile the ui file, I
see that it tries to instantiate it as FigureCanvasQTAgg(Parent) where
Parent is the parent widget, which seems to be the standard format for
instantiating widgets. However, FigureCanvasQTAgg expects a figure as
an argument.
I have seen this tutorial:
http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer
which suggests making a MatplotlibWidget to wrap the Canvas and set
everything up including the parent. I have written a version of this
for Qt4, but this seems like something that should be included in the
Qt4 backends. Any plans on adding this? I'd be happy to contribute.
Attached is my initial version.
I'm sorry I didn't respond before now, I've been swamped at work.
I agree that this would be a useful addition to matplotlib. I had been
thinking myself about whether to invest some time to develop some standard
widgets. This is a good place to start, I'll commit a modified version
sometime in the next week (it should respect rcParams, for example), but I'll
need some instructions on how to make Designer use the plugin. Would you
please consider writing a brief instruction that could be included in the
backend_qt4agg source?
Thanks for the submission,
Darren
ยทยทยท
On Wednesday 30 April 2008 04:32:51 am G Jones wrote: