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
On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...>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 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 :-) but I think many users would appreciate a GUI plot configuration dialog. JDH
2009年4月28日 John Hunter <jd...@gm...>: > > > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> > 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 :-) 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 > > JDH >
On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <co...@py...>wrote: > 2009年4月28日 John Hunter <jd...@gm...>: > > > > > > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> > > 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 :-) 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
Darren Dale wrote: > On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <co...@py... > <mailto:co...@py...>> wrote: > > 2009年4月28日 John Hunter <jd...@gm... <mailto:jd...@gm...>>: > > > > > > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut > <co...@py... <mailto:co...@py...>> > > 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 :-) 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 <dpe...@en...>: > Darren Dale wrote: > > On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <co...@py...> > wrote: >> >> 2009年4月28日 John Hunter <jd...@gm...>: >> > >> > >> > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> >> > 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 :-) 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 Cheers, Pierre
Hi Pierre, On Sat, Jun 6, 2009 at 11:49 AM, Pierre Raybaut <co...@py...>wrote: > 2009年4月28日 Dave Peterson <dpe...@en...>: > > Darren Dale wrote: > > > > On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <co...@py...> > > wrote: > >> > >> 2009年4月28日 John Hunter <jd...@gm...>: > >> > > >> > > >> > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py... > > > >> > 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 :-) 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, 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 :) 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 ;-) Pierre > I will see the results next week :) > > 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 >
Darren, Have you happened to review Pierre's patch for the toolbar improvement? I am interested to see this integrated in mpl soon. Thanks. On Mon, Nov 9, 2009 at 2:43 PM, Pierre Raybaut <co...@py...> wrote: > Hi, > > I've already sent everything to Darren. I don't have any news but I > guess that it will be integrated soon. > > Pierre > > 2009年11月9日 Gökhan Sever <gok...@gm...>: >> Hi Pierre, >> >> What is the latest status on this improvement? Will you give a patch >> to the matplotlib? >> >> Please let me know. >> >> Thanks >> >> On Sat, Jun 6, 2009 at 9:49 AM, Pierre Raybaut <co...@py...> wrote: >>> 2009年4月28日 Dave Peterson <dpe...@en...>: >>>> Darren Dale wrote: >>>> >>>> On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <co...@py...> >>>> wrote: >>>>> >>>>> 2009年4月28日 John Hunter <jd...@gm...>: >>>>> > >>>>> > >>>>> > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> >>>>> > 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 :-) 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 >>> >>> Cheers, >>> Pierre >>> >>> ------------------------------------------------------------------------------ >>> OpenSolaris 2009.06 is a cutting edge operating system for enterprises >>> looking to deploy the next generation of Solaris that includes the latest >>> innovations from Sun and the OpenSource community. Download a copy and >>> enjoy capabilities such as Networking, Storage and Virtualization. >>> Go to: http://p.sf.net/sfu/opensolaris-get >>> _______________________________________________ >>> Matplotlib-devel mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>> >> >> >> >> -- >> Gökhan >> > -- Gökhan
No, unfortunately I have not had time to review the patch. It is on my list. On Mon, Nov 9, 2009 at 3:47 PM, Gökhan Sever <gok...@gm...> wrote: > Darren, > > Have you happened to review Pierre's patch for the toolbar > improvement? I am interested to see this integrated in mpl soon. > > Thanks. > > On Mon, Nov 9, 2009 at 2:43 PM, Pierre Raybaut <co...@py...> wrote: >> Hi, >> >> I've already sent everything to Darren. I don't have any news but I >> guess that it will be integrated soon. >> >> Pierre >> >> 2009年11月9日 Gökhan Sever <gok...@gm...>: >>> Hi Pierre, >>> >>> What is the latest status on this improvement? Will you give a patch >>> to the matplotlib? >>> >>> Please let me know. >>> >>> Thanks >>> >>> On Sat, Jun 6, 2009 at 9:49 AM, Pierre Raybaut <co...@py...> wrote: >>>> 2009年4月28日 Dave Peterson <dpe...@en...>: >>>>> Darren Dale wrote: >>>>> >>>>> On Tue, Apr 28, 2009 at 12:19 PM, Pierre Raybaut <co...@py...> >>>>> wrote: >>>>>> >>>>>> 2009年4月28日 John Hunter <jd...@gm...>: >>>>>> > >>>>>> > >>>>>> > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> >>>>>> > 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 :-) 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 >>>> >>>> Cheers, >>>> Pierre >>>> >>>> ------------------------------------------------------------------------------ >>>> OpenSolaris 2009.06 is a cutting edge operating system for enterprises >>>> looking to deploy the next generation of Solaris that includes the latest >>>> innovations from Sun and the OpenSource community. Download a copy and >>>> enjoy capabilities such as Networking, Storage and Virtualization. >>>> Go to: http://p.sf.net/sfu/opensolaris-get >>>> _______________________________________________ >>>> Matplotlib-devel mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>>> >>> >>> >>> >>> -- >>> Gökhan >>> >> > > > > -- > Gökhan >
On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> 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* 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
2009年12月1日 Darren Dale <dsd...@gm...>: > On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> 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* > > 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... ;-) Anyway, now, you can't say no any longer :-) 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
On Sun, Jan 3, 2010 at 9:11 AM, Pierre Raybaut <co...@py...> wrote: > 2009年12月1日 Darren Dale <dsd...@gm...>: >> On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> 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* >> >> 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... ;-) [...] > 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:28 AM, Darren Dale <dsd...@gm...> 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
2010年1月3日 John Hunter <jd...@gm...>: > On Sun, Jan 3, 2010 at 9:28 AM, Darren Dale <dsd...@gm...> 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
On Sun, Jan 3, 2010 at 12:35 PM, John Hunter <jd...@gm...> wrote: > On Sun, Jan 3, 2010 at 9:28 AM, Darren Dale <dsd...@gm...> 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 > > 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 :) > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- Gökhan
On Sun, Jan 3, 2010 at 2:41 PM, Gökhan Sever <gok...@gm...> 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) Thanks, Pierre 2010年1月3日 John Hunter <jd...@gm...>: > On Sun, Jan 3, 2010 at 2:41 PM, Gökhan Sever <gok...@gm...> 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 >
Hi Pierre, Are you still maintaining the qt4 plot editor dialog? It doesn't appear to be working properly: setting the marker and linestyle options does not effect the plot (tested on Ubuntu Natty alpha, with the v1.0.x branch on python-2.7 and PyQt4-4.8.3). I have a really hard time following the code. Also, the dialog makes the qt4 backend unusable with PyQt4's API v2, which does not provide a QString object. Darren
On Sun, Feb 27, 2011 at 3:27 PM, Darren Dale <dsd...@gm...> wrote: > Hi Pierre, > > Are you still maintaining the qt4 plot editor dialog? It doesn't > appear to be working properly: setting the marker and linestyle > options does not effect the plot (tested on Ubuntu Natty alpha, with > the v1.0.x branch on python-2.7 and PyQt4-4.8.3). Sorry, I think this was a mistake on my part... > I have a really hard > time following the code. ... but I do have a really hard time understanding the code. > Also, the dialog makes the qt4 backend > unusable with PyQt4's API v2, which does not provide a QString object. This can be addressed with the following change, which I just @@ -56,9 +56,9 @@ from PyQt4.QtGui import (QWidget, QLineEdit, QComboBox, QLabel QPixmap, QTabWidget, QApplication, QStackedWidget, QDateEdit, QDateTimeEdit, QFont, QFontComboBox, QFontDatabase, QGridLayout) -from PyQt4.QtCore import (Qt, SIGNAL, SLOT, QSize, QString, +from PyQt4.QtCore import (Qt, SIGNAL, SLOT, QObject, QSize, pyqtSignature, pyqtProperty) import datetime class ColorButton(QPushButton): @@ -102,7 +102,8 @@ def text_to_qcolor(text): Avoid warning from Qt when an invalid QColor is instantiated """ color = QColor() - if isinstance(text, QString): + if isinstance(text, QObject): + # actually a QString, which is not provided by the new PyQt4 API: text = str(text) if not isinstance(text, (unicode, str)): return color
Hi Darren, > -----Message d'origine----- > De : Darren Dale [mailto:dsd...@gm...] > Envoyé : dimanche 27 février 2011 22:02 > À : Pierre Raybaut > Cc : matplotlib-devel > Objet : Re: [matplotlib-devel] Enhancement to matplotlib's > PyQt4 backend > > On Sun, Feb 27, 2011 at 3:27 PM, Darren Dale > <dsd...@gm...> wrote: > > Hi Pierre, > > > > Are you still maintaining the qt4 plot editor dialog? It doesn't > > appear to be working properly: setting the marker and linestyle > > options does not effect the plot (tested on Ubuntu Natty > alpha, with > > the v1.0.x branch on python-2.7 and PyQt4-4.8.3). > > Sorry, I think this was a mistake on my part... > > > I have a really hard > > time following the code. > > ... but I do have a really hard time understanding the code. Well it seems quite self-explanatory to me (especially the 'formlayout' module which is very OO which tends to hide code complexity), hence the lack of comments. But hey, I wrote it so I guess it's easier for me to read it. Anyway, please don't hesitate to ask questions about the part of the code that seems unclear. > > Also, the dialog makes the qt4 backend unusable with > PyQt4's API v2, > > which does not provide a QString object. > > This can be addressed with the following change, which I just > > @@ -56,9 +56,9 @@ from PyQt4.QtGui import (QWidget, > QLineEdit, QComboBox, QLabel > QPixmap, QTabWidget, QApplication, > QStackedWidget, > QDateEdit, QDateTimeEdit, QFont, > QFontComboBox, > QFontDatabase, QGridLayout) -from > PyQt4.QtCore import (Qt, SIGNAL, SLOT, QSize, QString, > +from PyQt4.QtCore import (Qt, SIGNAL, SLOT, QObject, QSize, > pyqtSignature, pyqtProperty) > import datetime > > > class ColorButton(QPushButton): > @@ -102,7 +102,8 @@ def text_to_qcolor(text): > Avoid warning from Qt when an invalid QColor is instantiated > """ > color = QColor() > - if isinstance(text, QString): > + if isinstance(text, QObject): > + # actually a QString, which is not provided by the > new PyQt4 API: > text = str(text) > if not isinstance(text, (unicode, str)): > return color > This seems ok to me. Cheers, Pierre
2010年1月3日 Darren Dale <dsd...@gm...>: > On Sun, Jan 3, 2010 at 9:11 AM, Pierre Raybaut <co...@py...> wrote: >> 2009年12月1日 Darren Dale <dsd...@gm...>: >>> On Tue, Apr 28, 2009 at 8:18 AM, Pierre Raybaut <co...@py...> 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* >>> >>> 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... ;-) > > [...] > >> 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 Mon, Jan 11, 2010 at 11:09 AM, Pierre Raybaut <co...@py...>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. > > Thanks, > Pierre > > 2010年1月3日 John Hunter <jd...@gm...>: > > On Sun, Jan 3, 2010 at 2:41 PM, Gökhan Sever <gok...@gm...> > 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
On Mon, Jan 11, 2010 at 11:53 AM, Gökhan Sever <gok...@gm...> wrote: > > > On Mon, Jan 11, 2010 at 11:09 AM, Pierre Raybaut <co...@py...> > 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. 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