Enhancement to matplotlib's PyQt4 backend

Hi all,

I would like to contribute to matplotlib with this enhancement for the
PyQt4 backend: the idea is to add a toolbar button to configure figure
options (axes, curves, ...).

It's based on a tiny module called formlayout to generate PyQt4 form
dialog automatically.

Some screenshots:
http://code.google.com/p/formlayout/

So, if you're interested (all the following is GPL2):

*matplotlib patch*

In FigureManagerQT.__init__, added:
self.canvas.axes = self.canvas.figure.add_subplot(111)

In NavigationToolbar2QT._init_toolbar, added:
a = self.addAction(self._icon("customize.png"), 'Customize',
self.edit_parameters)
a.setToolTip('Edit curves line and axes parameters')

Added the following method in NavigationToolbar2QT:
def edit_parameters(self):
    from figureoptions import figure_edit
    figure_edit(self.canvas, self)

*additionnal modules and data*

formlayout.py (http://code.google.com/p/formlayout/)
figureoptions.py (http://code.google.com/p/PyQtShell/)
customize.png (http://code.google.com/p/PyQtShell/)

cheers,
Pierre

Hi Pierre – this looks very nice (the last link is broken though , I get a 404 error). We would be happy to include this in matplotlib or as a toolkit. To contribute it to to mpl, the license needs to be matplotlib compatible (http://matplotlib.sourceforge.net/devel/coding_guide.html#licenses) but we have more licensing flexibility in a toolkit, though we prefer to keep everything BSD compatible where possible. And of course you would need to agree to maintain it :slight_smile: but I think many users would appreciate a GUI plot configuration dialog.

JDH

···

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@…604…> wrote:

Hi all,

I would like to contribute to matplotlib with this enhancement for the

PyQt4 backend: the idea is to add a toolbar button to configure figure

options (axes, curves, …).

It’s based on a tiny module called formlayout to generate PyQt4 form

dialog automatically.

Some screenshots:

http://code.google.com/p/formlayout/

So, if you’re interested (all the following is GPL2):

matplotlib patch

In FigureManagerQT.init, added:

self.canvas.axes = self.canvas.figure.add_subplot(111)

In NavigationToolbar2QT._init_toolbar, added:

a = self.addAction(self._icon(“customize.png”), ‘Customize’,

self.edit_parameters)

a.setToolTip(‘Edit curves line and axes parameters’)

Added the following method in NavigationToolbar2QT:

def edit_parameters(self):

from figureoptions import figure_edit

figure_edit(self.canvas, self)

additionnal modules and data

formlayout.py (http://code.google.com/p/formlayout/)

figureoptions.py (http://code.google.com/p/PyQtShell/)

customize.png (http://code.google.com/p/PyQtShell/)

2009/4/28 John Hunter <jdh2358@...149...>:

Hi all,

I would like to contribute to matplotlib with this enhancement for the
PyQt4 backend: the idea is to add a toolbar button to configure figure
options (axes, curves, ...).

It's based on a tiny module called formlayout to generate PyQt4 form
dialog automatically.

Some screenshots:
http://code.google.com/p/formlayout/

So, if you're interested (all the following is GPL2):

*matplotlib patch*

In FigureManagerQT.__init__, added:
self.canvas.axes = self.canvas.figure.add_subplot(111)

In NavigationToolbar2QT._init_toolbar, added:
a = self.addAction(self._icon("customize.png"), 'Customize',
self.edit_parameters)
a.setToolTip('Edit curves line and axes parameters')

Added the following method in NavigationToolbar2QT:
def edit_parameters(self):
from figureoptions import figure_edit
figure_edit(self.canvas, self)

*additionnal modules and data*

formlayout.py (http://code.google.com/p/formlayout/)
figureoptions.py (http://code.google.com/p/PyQtShell/)
customize.png (http://code.google.com/p/PyQtShell/)

Hi Pierre -- this looks very nice (the last link is broken though , I get a
404 error). We would be happy to include this in matplotlib or as a

Here is the last link:
http://code.google.com/p/pyqtshell/

toolkit. To contribute it to to mpl, the license needs to be matplotlib
compatible
(http://matplotlib.sourceforge.net/devel/coding_guide.html#licenses) but we
have more licensing flexibility in a toolkit, though we prefer to keep
everything BSD compatible where possible. And of course you would need to
agree to maintain it :slight_smile: but I think many users would appreciate a GUI plot
configuration dialog.

I was not aware of this license restriction in matplotlib... I fully
understand the motivation, of course, but still: I wrote all this on
my free time which means no PyQt4 commercial license, so it can't be
anything but GPL. Sorry...

Pierre

···

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@...604...> > wrote:

JDH

"PyQt is GPL but has exceptions that allow it to be used with BSD code -

hence it’s Ok for TraitsBackendQt to be BSD.

However, the exception imposes additional conditions which, to all intents

and purposes, infects the code with the GPL. To be fair to people that

should be made clear in any text.

It’s still a good idea for TraitsBackendQt to use a BSD license because it

allows commercial (ie. non-GPL) users to use it without problems."

Darren

···

On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <contact@…604…> wrote:

2009/4/28 John Hunter <jdh2358@…149…>:

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@…604…> > > > wrote:

Hi all,

I would like to contribute to matplotlib with this enhancement for the

PyQt4 backend: the idea is to add a toolbar button to configure figure

options (axes, curves, …).

It’s based on a tiny module called formlayout to generate PyQt4 form

dialog automatically.

Some screenshots:

http://code.google.com/p/formlayout/

So, if you’re interested (all the following is GPL2):

matplotlib patch

In FigureManagerQT.init, added:

self.canvas.axes = self.canvas.figure.add_subplot(111)

In NavigationToolbar2QT._init_toolbar, added:

a = self.addAction(self._icon(“customize.png”), ‘Customize’,

self.edit_parameters)

a.setToolTip(‘Edit curves line and axes parameters’)

Added the following method in NavigationToolbar2QT:

def edit_parameters(self):

from figureoptions import figure_edit

figure_edit(self.canvas, self)

additionnal modules and data

formlayout.py (http://code.google.com/p/formlayout/)

figureoptions.py (http://code.google.com/p/PyQtShell/)

customize.png (http://code.google.com/p/PyQtShell/)

Hi Pierre – this looks very nice (the last link is broken though , I get a

404 error). We would be happy to include this in matplotlib or as a

Here is the last link:

http://code.google.com/p/pyqtshell/

toolkit. To contribute it to to mpl, the license needs to be matplotlib

compatible

(http://matplotlib.sourceforge.net/devel/coding_guide.html#licenses) but we

have more licensing flexibility in a toolkit, though we prefer to keep

everything BSD compatible where possible. And of course you would need to

agree to maintain it :slight_smile: but I think many users would appreciate a GUI plot

configuration dialog.

I was not aware of this license restriction in matplotlib… I fully

understand the motivation, of course, but still: I wrote all this on

my free time which means no PyQt4 commercial license, so it can’t be

anything but GPL. Sorry…

I think you have overlooked a subtlety of PyQt4’s license. The author of PyQt4 wrote on the enthought-dev mailing list:

Darren Dale wrote:

···

On Tue, Apr 28, 2009 at 12:19 PM, Pierre > Raybaut <contact@…604…> > wrote:

2009/4/28
John Hunter <jdh2358@…149…>:

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@…604…> > > > > > wrote:

Hi all,

I would like to contribute to matplotlib with this enhancement
for the

PyQt4 backend: the idea is to add a toolbar button to
configure figure

options (axes, curves, …).

It’s based on a tiny module called formlayout to generate
PyQt4 form

dialog automatically.

Some screenshots:

http://code.google.com/p/formlayout/

So, if you’re interested (all the following is GPL2):

matplotlib patch

In FigureManagerQT.init, added:

self.canvas.axes = self.canvas.figure.add_subplot(111)

In NavigationToolbar2QT._init_toolbar, added:

a = self.addAction(self._icon(“customize.png”), ‘Customize’,

self.edit_parameters)

a.setToolTip(‘Edit curves line and axes parameters’)

Added the following method in NavigationToolbar2QT:

def edit_parameters(self):

from figureoptions import figure_edit

figure_edit(self.canvas, self)

additionnal modules and data

formlayout.py (http://code.google.com/p/formlayout/)

figureoptions.py (http://code.google.com/p/PyQtShell/)

customize.png (http://code.google.com/p/PyQtShell/)

Hi Pierre – this looks very nice (the last link is broken though
, I get a

404 error). We would be happy to include this in matplotlib or as
a

Here is the last link:

[http://code.google.com/p/pyqtshell/](http://code.google.com/p/pyqtshell/)

toolkit. To contribute it to to mpl, the license needs to be
matplotlib

compatible

(http://matplotlib.sourceforge.net/devel/coding_guide.html#licenses)
but we

have more licensing flexibility in a toolkit, though we prefer to
keep

everything BSD compatible where possible. And of course you
would need to

agree to maintain it :slight_smile: but I think many users would appreciate a
GUI plot

configuration dialog.

I was not aware of this license restriction in matplotlib… I fully

understand the motivation, of course, but still: I wrote all this on

my free time which means no PyQt4 commercial license, so it can’t be

anything but GPL. Sorry…

I think you have overlooked a subtlety of PyQt4’s license. The author
of PyQt4 wrote on the enthought-dev mailing list:

"PyQt is GPL but has exceptions that allow it to be used with BSD code -

hence it’s Ok for TraitsBackendQt to be BSD.

However, the exception imposes additional conditions which, to all
intents

and purposes, infects the code with the GPL. To be fair to people that

should be made clear in any text.

It’s still a good idea for TraitsBackendQt to use a BSD
license because it

allows commercial (ie. non-GPL) users to use it without problems."

Darren

I think it might be worth contacting the PyQt folks (Phil Thompson)
about this. I think there might be some differences here because Phil
was the author of TraitsBackendQt and thus his efforts didn’t quite
fall under the “develop under a free license, your results needs to be
GPL” clause Qt/PyQt have in their licensing.

– Dave

2009/4/28 Dave Peterson <dpeterson@...492...>:

Darren Dale wrote:

2009/4/28 John Hunter <jdh2358@...149...>:
>
>
>>
>> Hi all,
>>
>> I would like to contribute to matplotlib with this enhancement for the
>> PyQt4 backend: the idea is to add a toolbar button to configure figure
>> options (axes, curves, ...).
>>
>> It's based on a tiny module called formlayout to generate PyQt4 form
>> dialog automatically.
>>
>> Some screenshots:
>> http://code.google.com/p/formlayout/
>>
>> So, if you're interested (all the following is GPL2):
>>
>> *matplotlib patch*
>>
>> In FigureManagerQT.__init__, added:
>> self.canvas.axes = self.canvas.figure.add_subplot(111)
>>
>> In NavigationToolbar2QT._init_toolbar, added:
>> a = self.addAction(self._icon("customize.png"), 'Customize',
>> self.edit_parameters)
>> a.setToolTip('Edit curves line and axes parameters')
>>
>> Added the following method in NavigationToolbar2QT:
>> def edit_parameters(self):
>> from figureoptions import figure_edit
>> figure_edit(self.canvas, self)
>>
>> *additionnal modules and data*
>>
>> formlayout.py (http://code.google.com/p/formlayout/)
>> figureoptions.py (http://code.google.com/p/PyQtShell/)
>> customize.png (http://code.google.com/p/PyQtShell/)
>
> Hi Pierre -- this looks very nice (the last link is broken though , I
> get a
> 404 error). We would be happy to include this in matplotlib or as a

Here is the last link:
http://code.google.com/p/pyqtshell/

> toolkit. To contribute it to to mpl, the license needs to be
> matplotlib
> compatible
> (http://matplotlib.sourceforge.net/devel/coding_guide.html#licenses) but
> we
> have more licensing flexibility in a toolkit, though we prefer to keep
> everything BSD compatible where possible. And of course you would need
> to
> agree to maintain it :slight_smile: but I think many users would appreciate a GUI
> plot
> configuration dialog.

I was not aware of this license restriction in matplotlib... I fully
understand the motivation, of course, but still: I wrote all this on
my free time which means no PyQt4 commercial license, so it can't be
anything but GPL. Sorry...

I think you have overlooked a subtlety of PyQt4's license. The author of

"PyQt is GPL but has exceptions that allow it to be used with BSD code -
hence it's Ok for TraitsBackendQt to be BSD.

However, the exception imposes additional conditions which, to all intents
and purposes, infects the code with the GPL. To be fair to people that
should be made clear in any text.

It's still a good idea for TraitsBackendQt to use a BSD license because it
allows commercial (ie. non-GPL) users to use it without problems."

Darren

I think it might be worth contacting the PyQt folks (Phil Thompson) about
this. I think there might be some differences here because Phil was the
author of TraitsBackendQt and thus his efforts didn't quite fall under the
"develop under a free license, your results needs to be GPL" clause Qt/PyQt
have in their licensing.

-- Dave

Hi all,

Dave, you are absolutely right.

Last week-end, I found myself surfing on PyQt's website and I told to
myself: what about re-reading the license? (always a pleasure) And
surprisingly, I found out that anyone using the GPL version of PyQt
can release source code under a very permissive license (like MIT or
BSD) thanks to the PyQt-GPL Exception, as long as PyQt itself is not
part of the distributed package (otherwise the whole package has to be
licensed under GPL) - and with other little restrictions. It was a
surprise because I've read here and there a lot of things on PyQt
license and the general idea was "if you write PyQt code without the
commercial license, your code *must* be licensed under GPL" - I can
tell now that it's not true (to be absolutely certain about it, I even
asked to Phil Thompson to confirm this, and he did).

So, I switched all the code I was referring to in my original e-mail
to MIT license.
I guess now it could be integrated to matplotlib Qt4 backend?

formlayout (generate option dialogs):
http://code.google.com/p/formlayout/

pydee (IDE which integrates matplotlib and the option dialog):
http://code.google.com/p/pydee/
Meanwhile, thanks to the brand new Google-code Mercurial support, you
may browse the source code if you like:
http://code.google.com/p/pydee/source/browse/pydeelib/widgets/figureoptions.py

Cheers,
Pierre

···

On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <contact@...604...> > wrote:

> On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@...604...> >> > wrote:

PyQt4 wrote on the enthought-dev mailing list:

Hi,

formlayout will definitely a very nice addition to matplotlib Qt4 backended plotting windows. It reminds me Traits UI’s configure.traits() method.

PyQt4 programming is still a mystery to me, and have chosen to learn Traits instead.

I am also curious to know what happened to pydee - IPython integration plans?

I should also mention, I have started a weekly Python meeting in our department. I highly recommended to Windows users to start with Python(X,Y). I will see the results next week :slight_smile:

Gökhan

···

Hi all,

Dave, you are absolutely right.

Last week-end, I found myself surfing on PyQt’s website and I told to

myself: what about re-reading the license? (always a pleasure) And

surprisingly, I found out that anyone using the GPL version of PyQt

can release source code under a very permissive license (like MIT or

BSD) thanks to the PyQt-GPL Exception, as long as PyQt itself is not

part of the distributed package (otherwise the whole package has to be

licensed under GPL) - and with other little restrictions. It was a

surprise because I’ve read here and there a lot of things on PyQt

license and the general idea was "if you write PyQt code without the

commercial license, your code must be licensed under GPL" - I can

tell now that it’s not true (to be absolutely certain about it, I even

asked to Phil Thompson to confirm this, and he did).

So, I switched all the code I was referring to in my original e-mail

to MIT license.

I guess now it could be integrated to matplotlib Qt4 backend?

formlayout (generate option dialogs):

http://code.google.com/p/formlayout/

pydee (IDE which integrates matplotlib and the option dialog):

http://code.google.com/p/pydee/

Meanwhile, thanks to the brand new Google-code Mercurial support, you

may browse the source code if you like:

http://code.google.com/p/pydee/source/browse/pydeelib/widgets/figureoptions.py

Cheers,

Pierre

Gökhan SEVER a écrit :

Hi,

formlayout will definitely a very nice addition to matplotlib Qt4 backended plotting windows. It reminds me Traits UI's configure.traits() method.

PyQt4 programming is still a mystery to me, and have chosen to learn Traits instead.

I am also curious to know what happened to pydee - IPython integration plans?

I changed its priority but the IPython integration in pydee is still planned for this summer.
To be honest, I didn't have the time to work on this for a long time now (actually since the IPython PyQt4 frontend demo I've coded in April).
In the meantime, I concentrated on cleaning the code, fixing a lot of bugs, improving performances (Workspace mainly) and adding new features: console in a separate process (the "external console": running scripts, debugging, interacting, opening a Python interpreter... with code-completion, calltips, ...), files/directories explorer, class browser, fast code analysis (pyflakes), find in files (next release)...

I should also mention, I have started a weekly Python meeting in our department. I highly recommended to Windows users to start with Python(X,Y).

Of course, I agree that is certainly the best thing to do :wink:

Pierre

···

I will see the results next week :slight_smile:

Gökhan

    Hi all,

    Dave, you are absolutely right.

    Last week-end, I found myself surfing on PyQt's website and I told to
    myself: what about re-reading the license? (always a pleasure) And
    surprisingly, I found out that anyone using the GPL version of PyQt
    can release source code under a very permissive license (like MIT or
    BSD) thanks to the PyQt-GPL Exception, as long as PyQt itself is not
    part of the distributed package (otherwise the whole package has to be
    licensed under GPL) - and with other little restrictions. It was a
    surprise because I've read here and there a lot of things on PyQt
    license and the general idea was "if you write PyQt code without the
    commercial license, your code *must* be licensed under GPL" - I can
    tell now that it's not true (to be absolutely certain about it, I even
    asked to Phil Thompson to confirm this, and he did).

    So, I switched all the code I was referring to in my original e-mail
    to MIT license.
    I guess now it could be integrated to matplotlib Qt4 backend?

    formlayout (generate option dialogs):
    http://code.google.com/p/formlayout/

    pydee (IDE which integrates matplotlib and the option dialog):
    http://code.google.com/p/pydee/
    Meanwhile, thanks to the brand new Google-code Mercurial support, you
    may browse the source code if you like:
    http://code.google.com/p/pydee/source/browse/pydeelib/widgets/figureoptions.py

    Cheers,
    Pierre

Hi Pierre,

···

On Sat, Jun 6, 2009 at 11:49 AM, Pierre Raybaut <contact@…604…> wrote:

2009/4/28 Dave Peterson <dpeterson@…492…>:

Darren Dale wrote:

On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <contact@…604…> > > > wrote:

2009/4/28 John Hunter <jdh2358@…149…>:

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@…604…> > > >> > wrote:

Hi all,

I would like to contribute to matplotlib with this enhancement for the

PyQt4 backend: the idea is to add a toolbar button to configure figure

options (axes, curves, …).

It’s based on a tiny module called formlayout to generate PyQt4 form

dialog automatically.

Some screenshots:

http://code.google.com/p/formlayout/

So, if you’re interested (all the following is GPL2):

matplotlib patch

In FigureManagerQT.init, added:

self.canvas.axes = self.canvas.figure.add_subplot(111)

In NavigationToolbar2QT._init_toolbar, added:

a = self.addAction(self._icon(“customize.png”), ‘Customize’,

self.edit_parameters)

a.setToolTip(‘Edit curves line and axes parameters’)

Added the following method in NavigationToolbar2QT:

def edit_parameters(self):

from figureoptions import figure_edit

figure_edit(self.canvas, self)

additionnal modules and data

formlayout.py (http://code.google.com/p/formlayout/)

figureoptions.py (http://code.google.com/p/PyQtShell/)

customize.png (http://code.google.com/p/PyQtShell/)

Hi Pierre – this looks very nice (the last link is broken though , I

get a

404 error). We would be happy to include this in matplotlib or as a

Here is the last link:

http://code.google.com/p/pyqtshell/

toolkit. To contribute it to to mpl, the license needs to be

matplotlib

compatible

(http://matplotlib.sourceforge.net/devel/coding_guide.html#licenses) but

we

have more licensing flexibility in a toolkit, though we prefer to keep

everything BSD compatible where possible. And of course you would need

to

agree to maintain it :slight_smile: but I think many users would appreciate a GUI

plot

configuration dialog.

I was not aware of this license restriction in matplotlib… I fully

understand the motivation, of course, but still: I wrote all this on

my free time which means no PyQt4 commercial license, so it can’t be

anything but GPL. Sorry…

I think you have overlooked a subtlety of PyQt4’s license. The author of

PyQt4 wrote on the enthought-dev mailing list:

"PyQt is GPL but has exceptions that allow it to be used with BSD code -

hence it’s Ok for TraitsBackendQt to be BSD.

However, the exception imposes additional conditions which, to all intents

and purposes, infects the code with the GPL. To be fair to people that

should be made clear in any text.

It’s still a good idea for TraitsBackendQt to use a BSD license because it

allows commercial (ie. non-GPL) users to use it without problems."

Darren

I think it might be worth contacting the PyQt folks (Phil Thompson) about

this. I think there might be some differences here because Phil was the

author of TraitsBackendQt and thus his efforts didn’t quite fall under the

“develop under a free license, your results needs to be GPL” clause Qt/PyQt

have in their licensing.

– Dave

Hi all,

Dave, you are absolutely right.

Last week-end, I found myself surfing on PyQt’s website and I told to

myself: what about re-reading the license? (always a pleasure) And

surprisingly, I found out that anyone using the GPL version of PyQt

can release source code under a very permissive license (like MIT or

BSD) thanks to the PyQt-GPL Exception, as long as PyQt itself is not

part of the distributed package (otherwise the whole package has to be

licensed under GPL) - and with other little restrictions. It was a

surprise because I’ve read here and there a lot of things on PyQt

license and the general idea was "if you write PyQt code without the

commercial license, your code must be licensed under GPL" - I can

tell now that it’s not true (to be absolutely certain about it, I even

asked to Phil Thompson to confirm this, and he did).

So, I switched all the code I was referring to in my original e-mail

to MIT license.

I guess now it could be integrated to matplotlib Qt4 backend?

formlayout (generate option dialogs):
http://code.google.com/p/formlayout/

pydee (IDE which integrates matplotlib and the option dialog):

http://code.google.com/p/pydee/

Meanwhile, thanks to the brand new Google-code Mercurial support, you

may browse the source code if you like:

http://code.google.com/p/pydee/source/browse/pydeelib/widgets/figureoptions.py

Do you have the customize image in svg, and do you have the right to release it under the terms of the matplotlib license? Would you be willing to provide feedback in the future if problems are reported?

Darren

Hi all,

I would like to contribute to matplotlib with this enhancement for the
PyQt4 backend: the idea is to add a toolbar button to configure figure
options (axes, curves, ...).

It's based on a tiny module called formlayout to generate PyQt4 form
dialog automatically.

Some screenshots:
http://code.google.com/p/formlayout/

So, if you're interested (all the following is GPL2):

*matplotlib patch*

Would you please submit an actual patch? I don't know exactly where
you intend these changes to be placed.

In FigureManagerQT.__init__, added:
self.canvas.axes = self.canvas.figure.add_subplot(111)

What is the purpose of this change? What if I didn't want such an axes
on my canvas? What if I want to layout my own axes([.2,.2,.75,.75]) or
add_subplot(311)? I don't think these changes can be accepted in the
current form, they don't appear to integrate well with the standard
behavior of the library.

In NavigationToolbar2QT._init_toolbar, added:
a = self.addAction(self._icon("customize.png"), 'Customize',
self.edit_parameters)
a.setToolTip('Edit curves line and axes parameters')

Added the following method in NavigationToolbar2QT:
def edit_parameters(self):
from figureoptions import figure_edit
figure_edit(self.canvas, self)

*additionnal modules and data*

formlayout.py (http://code.google.com/p/formlayout/)
figureoptions.py (http://code.google.com/p/PyQtShell/)
customize.png (http://code.google.com/p/PyQtShell/)

Darren

···

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@...604...> wrote:

2009/12/1 Darren Dale <dsdale24@...149...>:

Hi all,

I would like to contribute to matplotlib with this enhancement for the
PyQt4 backend: the idea is to add a toolbar button to configure figure
options (axes, curves, ...).

It's based on a tiny module called formlayout to generate PyQt4 form
dialog automatically.

Some screenshots:
http://code.google.com/p/formlayout/

So, if you're interested (all the following is GPL2):

*matplotlib patch*

Would you please submit an actual patch? I don't know exactly where
you intend these changes to be placed.

In FigureManagerQT.__init__, added:
self.canvas.axes = self.canvas.figure.add_subplot(111)

What is the purpose of this change? What if I didn't want such an axes
on my canvas? What if I want to layout my own axes([.2,.2,.75,.75]) or
add_subplot(311)? I don't think these changes can be accepted in the
current form, they don't appear to integrate well with the standard
behavior of the library.

Darren

Ok, I admit that it was very difficult to fix this -- it took me a lot
of seconds without knowing very well matplotlib... :wink:

Anyway, now, you can't say no any longer :slight_smile:
Here is a zip file containing all you need (patch for backend_qt4.py,
two scripts to be copied in backends/, and one .svg image to be copied
to mpl-data/images/) -- I can't make it clearer than this...

Cheers,
Pierre

mpl_qt4_options.zip (9.13 KB)

···

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@...604...> wrote:

2009/12/1 Darren Dale <dsdale24@...149...>:

Hi all,

I would like to contribute to matplotlib with this enhancement for the
PyQt4 backend: the idea is to add a toolbar button to configure figure
options (axes, curves, ...).

It's based on a tiny module called formlayout to generate PyQt4 form
dialog automatically.

Some screenshots:
http://code.google.com/p/formlayout/

So, if you're interested (all the following is GPL2):

*matplotlib patch*

Would you please submit an actual patch? I don't know exactly where
you intend these changes to be placed.

In FigureManagerQT.__init__, added:
self.canvas.axes = self.canvas.figure.add_subplot(111)

What is the purpose of this change? What if I didn't want such an axes
on my canvas? What if I want to layout my own axes([.2,.2,.75,.75]) or
add_subplot(311)? I don't think these changes can be accepted in the
current form, they don't appear to integrate well with the standard
behavior of the library.

Darren

Ok, I admit that it was very difficult to fix this -- it took me a lot
of seconds without knowing very well matplotlib... :wink:

[...]

Here is a zip file containing all you need (patch for backend_qt4.py,
two scripts to be copied in backends/, and one .svg image to be copied
to mpl-data/images/)

[...]

Your patch file is backwards, it would revert your changes if applied
to the updated code. It doesn't matter, the patch is so small that the
changes can just be cut and pasted. Unfortunately, however, I will not
have time to review your contribution closely enough to consider
committing it for at least two weeks, maybe more (conference and long
hours at work). I'll look into it when I get a chance, if someone else
doesn't beat me to it.

Darren

···

On Sun, Jan 3, 2010 at 9:11 AM, Pierre Raybaut <contact@...604...> wrote:

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@...604...> wrote:

Hey Pierre, Darren,

I took a stab at this. I put the helper code in a backends.qt4_editor
package, and put the toolbar button right after the configure subplots
button. Thanks for the patch and the license change Pierre, and sorry
it took us so long to incorporate it. Let me know if any of the
reorganizations are a problem for you.

JDH

···

On Sun, Jan 3, 2010 at 9:28 AM, Darren Dale <dsdale24@...149...> wrote:

Your patch file is backwards, it would revert your changes if applied
to the updated code. It doesn't matter, the patch is so small that the
changes can just be cut and pasted. Unfortunately, however, I will not
have time to review your contribution closely enough to consider
committing it for at least two weeks, maybe more (conference and long
hours at work). I'll look into it when I get a chance, if someone else
doesn't beat me to it.

2010/1/3 Darren Dale <dsdale24@...149...>:

2009/12/1 Darren Dale <dsdale24@...149...>:

Hi all,

I would like to contribute to matplotlib with this enhancement for the
PyQt4 backend: the idea is to add a toolbar button to configure figure
options (axes, curves, ...).

It's based on a tiny module called formlayout to generate PyQt4 form
dialog automatically.

Some screenshots:
http://code.google.com/p/formlayout/

So, if you're interested (all the following is GPL2):

*matplotlib patch*

Would you please submit an actual patch? I don't know exactly where
you intend these changes to be placed.

In FigureManagerQT.__init__, added:
self.canvas.axes = self.canvas.figure.add_subplot(111)

What is the purpose of this change? What if I didn't want such an axes
on my canvas? What if I want to layout my own axes([.2,.2,.75,.75]) or
add_subplot(311)? I don't think these changes can be accepted in the
current form, they don't appear to integrate well with the standard
behavior of the library.

Darren

Ok, I admit that it was very difficult to fix this -- it took me a lot
of seconds without knowing very well matplotlib... :wink:

[...]

Here is a zip file containing all you need (patch for backend_qt4.py,
two scripts to be copied in backends/, and one .svg image to be copied
to mpl-data/images/)

[...]

Your patch file is backwards, it would revert your changes if applied
to the updated code.

Sorry for this... I admit that I did this maybe too quickly.

It doesn't matter, the patch is so small that the
changes can just be cut and pasted. Unfortunately, however, I will not
have time to review your contribution closely enough to consider
committing it for at least two weeks, maybe more (conference and long
hours at work). I'll look into it when I get a chance, if someone else
doesn't beat me to it.

Darren

No problem, this is already part of Spyder's matplotlib patch for six
months now, and I'm only using matplotlib through Spyder, so there is
absolutely no hurry for me. Since the beginning I was just trying to
be useful, to share something. I simply thought that this kind of
feature was missing in matplotlib: matplotlib produces good looking
figures but -compared to MATLAB- there is a serious lack of
interactivity (and performance -- but matplotlib is at worst as slow
as MATLAB, so it doesn't matter much).

Pierre

···

On Sun, Jan 3, 2010 at 9:11 AM, Pierre Raybaut <contact@...604...> wrote:

On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <contact@...604...> wrote:

2010/1/3 John Hunter <jdh2358@...149...>:

···

On Sun, Jan 3, 2010 at 9:28 AM, Darren Dale <dsdale24@...149...> wrote:

Your patch file is backwards, it would revert your changes if applied
to the updated code. It doesn't matter, the patch is so small that the
changes can just be cut and pasted. Unfortunately, however, I will not
have time to review your contribution closely enough to consider
committing it for at least two weeks, maybe more (conference and long
hours at work). I'll look into it when I get a chance, if someone else
doesn't beat me to it.

Hey Pierre, Darren,

I took a stab at this. I put the helper code in a backends.qt4_editor
package, and put the toolbar button right after the configure subplots
button. Thanks for the patch and the license change Pierre, and sorry
it took us so long to incorporate it. Let me know if any of the
reorganizations are a problem for you.

JDH

That is perfect!
Thanks very much John.

Pierre

Your patch file is backwards, it would revert your changes if applied

to the updated code. It doesn’t matter, the patch is so small that the

changes can just be cut and pasted. Unfortunately, however, I will not

have time to review your contribution closely enough to consider

committing it for at least two weeks, maybe more (conference and long

hours at work). I’ll look into it when I get a chance, if someone else

doesn’t beat me to it.

Hey Pierre, Darren,

I took a stab at this. I put the helper code in a backends.qt4_editor

package, and put the toolbar button right after the configure subplots

button. Thanks for the patch and the license change Pierre, and sorry

it took us so long to incorporate it. Let me know if any of the

reorganizations are a problem for you.

JDH

John,

You seemed like forgetting to check-in the qt4_editor_options.svg, because I get file not found error:

I[2]: Cannot open file ‘…/matplotlib/lib/matplotlib/mpl-data/images/qt4_editor_options.svg’, because: No such file or directory

Besides, thanks for including this improvement in the trunk. It was long time waited :slight_smile:

···

On Sun, Jan 3, 2010 at 12:35 PM, John Hunter <jdh2358@…552…149…> wrote:

On Sun, Jan 3, 2010 at 9:28 AM, Darren Dale <dsdale24@…149…> wrote:


This SF.Net email is sponsored by the Verizon Developer Community

Take advantage of Verizon’s best-in-class app development support

A streamlined, 14 day to market process makes app distribution fast and easy

Join now and get one step closer to millions of Verizon customers

http://p.sf.net/sfu/verizon-dev2dev


Matplotlib-devel mailing list

Matplotlib-devel@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Gökhan

Oops, just added. Thanks for the head's up.

JDH

···

On Sun, Jan 3, 2010 at 2:41 PM, Gökhan Sever <gokhansever@...149...> wrote:

You seemed like forgetting to check-in the qt4_editor_options.svg, because I
get file not found error:

I[2]: Cannot open file
'.../matplotlib/lib/matplotlib/mpl-data/images/qt4_editor_options.svg',
because: No such file or directory

John,

Following to your last commit on "added qt4_editor dialog" (rev 8064),
here is a significant (but simple) improvement adding an "Apply"
button to the option dialog box (very convenient) -- suggested by
Gökhan.

(attached diff files should patch formlayout.py and figureoptions.py
as in rev. 8064)

Thanks,
Pierre

2010/1/3 John Hunter <jdh2358@...149...>:

formlayout.py.diff (4 KB)

figureoptions.py.diff (3.27 KB)

···

On Sun, Jan 3, 2010 at 2:41 PM, Gökhan Sever <gokhansever@...149...> wrote:

You seemed like forgetting to check-in the qt4_editor_options.svg, because I
get file not found error:

I[2]: Cannot open file
'.../matplotlib/lib/matplotlib/mpl-data/images/qt4_editor_options.svg',
because: No such file or directory

Oops, just added. Thanks for the head's up.

JDH

John,

Following to your last commit on “added qt4_editor dialog” (rev 8064),

here is a significant (but simple) improvement adding an “Apply”

button to the option dialog box (very convenient) – suggested by

Gökhan.

(attached diff files should patch formlayout.py and figureoptions.py

as in rev. 8064)

One minor update:

After patching these two files, just change the ‘options.svg’ in figureoptions.py to “qt4_editor_options.svg” to suppress the icon not found error message.

···

On Mon, Jan 11, 2010 at 11:09 AM, Pierre Raybaut <contact@…604…> wrote:

Thanks,

Pierre

2010/1/3 John Hunter <jdh2358@…322…9…>:

On Sun, Jan 3, 2010 at 2:41 PM, Gökhan Sever <gokhansever@…746…49…> wrote:

You seemed like forgetting to check-in the qt4_editor_options.svg, because I

get file not found error:

I[2]: Cannot open file

‘…/matplotlib/lib/matplotlib/mpl-data/images/qt4_editor_options.svg’,

because: No such file or directory

Oops, just added. Thanks for the head’s up.

JDH


Gökhan

Hey Gökhan, if you could just create an "svn diff" with the original
patches applied and your changes it will be easiest for me to apply
that way.

JDH

···

On Mon, Jan 11, 2010 at 11:53 AM, Gökhan Sever <gokhansever@...149...> wrote:

On Mon, Jan 11, 2010 at 11:09 AM, Pierre Raybaut <contact@...604...> > wrote:

John,

Following to your last commit on "added qt4_editor dialog" (rev 8064),
here is a significant (but simple) improvement adding an "Apply"
button to the option dialog box (very convenient) -- suggested by
Gökhan.

(attached diff files should patch formlayout.py and figureoptions.py
as in rev. 8064)

One minor update:

After patching these two files, just change the 'options.svg' in
figureoptions.py to "qt4_editor_options.svg" to suppress the icon not found
error message.