Qt4Agg backend - edit curves and axis parameters

Hello,

I have just chaged over to the Qt4Agg backend so I can use Pierre Raybaut's
addition of editing cuves and parameters (thanks for this functionality). I
have found a small issue. Whenever I apply changes with more than one
trace/curve, the colour of the second curve changes. The example below is
enough to show the issue:

from matplotlib import pyplot
import numpy as np

a = np.random.rand(100)
b =a*1.5
fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.plot(a)
ax.plot(b)
pyplot.show()

The example above changes second trace from a default of green to a light
green when I use the edit button. Just pressing 'apply' without any changes
should be enough to trigger the change. It appears that the addin is not
getting the correct color from the plot and so apply is appying the
incorrect color back into the plot.

Also if I try to set color for a trace like this:
fig = pyplot.figure()
ax = fig.add_subplot(111)
ax.plot(a,'r')
pyplot.show()
It works but then when I press the edit curves button, I get:

Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4.py",
line 469, in edit_parameters
    figureoptions.figure_edit(axes, self)
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\figureoptions.py",
line 154, in figure_edit
    icon=get_icon('qt4_editor_options.svg'), apply=apply_callback)
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py",
line 460, in fedit
    dialog = FormDialog(data, title, comment, icon, parent, apply)
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py",
line 384, in __init__
    parent=self)
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py",
line 362, in __init__
    widget = FormComboWidget(data, comment=comment, parent=self)
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py",
line 344, in __init__
    widget = FormWidget(data, comment=comment, parent=self)
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py",
line 233, in __init__
    self.setup()
  File
"C:\Python26\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py",
line 256, in setup
    selindex = value.pop(0)
AttributeError: 'tuple' object has no attribute 'pop'

I am on version 1.0.0 and XP

Thanks,
Bevan

···


View this message in context: http://old.nabble.com/Qt4Agg-backend---edit-curves-and-axis-parameters-tp29754925p29754925.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Didn’t we just have a bug report/fix for this one?

Ben Root

···

On Sun, Sep 19, 2010 at 5:23 PM, bevan j <bevan07@…287…> wrote:

selindex = value.pop(0)

AttributeError: ‘tuple’ object has no attribute ‘pop’

Benjamin Root-2 wrote:

   selindex = value.pop(0)
AttributeError: 'tuple' object has no attribute 'pop'

Didn't we just have a bug report/fix for this one?

Sorry if it has already been reported I searched in the bug reports for
qt4agg and didn't find anything. Although I may have been looking in the
wrong place.
I have also noticed that editing some parameters (or pressing apply without
any changes) alters others. For instance if I have:
from matplotlib import pyplot
import numpy as np

a = np.random.rand(12)

fig = pyplot.figure()
ax = fig.add_subplot(111)
wdth = 0.20
ind = np.arange(a.size)
mon_ticks =('Jan','Feb','Mar','Apr','May','Jun','Jul', 'Aug', 'Sep', 'Oct',
'Nov','Dec')
ax.bar(ind, a, wdth, color='0.8')
ax.set_xticks(ind)
ax.set_xticklabels(mon_ticks)
pyplot.show()
Then pressing apply removes the ticks and tick label setting.

Hopefully this is adressed in the bug report you mention. Thanks.

···

On Sun, Sep 19, 2010 at 5:23 PM, bevan j <bevan07@...287...> wrote:

--
View this message in context: http://old.nabble.com/Qt4Agg-backend---edit-curves-and-axis-parameters-tp29754925p29764881.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Bevan, don’t worry, the question wasn’t directed to you.

I found the email I was thinking of: http://permalink.gmane.org/gmane.comp.python.matplotlib.devel/9212

Titled: [PATCH] Fix line color setting on Qt4

I don’t know if this addresses the other issues the Bevan made, though…

Ben Root

···

On Mon, Sep 20, 2010 at 6:44 PM, bevan j <bevan07@…287…> wrote:

Benjamin Root-2 wrote:

On Sun, Sep 19, 2010 at 5:23 PM, bevan j <bevan07@…287…> wrote:

selindex = value.pop(0)

AttributeError: ‘tuple’ object has no attribute ‘pop’

Didn’t we just have a bug report/fix for this one?

Sorry if it has already been reported I searched in the bug reports for

qt4agg and didn’t find anything. Although I may have been looking in the

wrong place.

I have also noticed that editing some parameters (or pressing apply without

any changes) alters others. For instance if I have:
from matplotlib import pyplot

import numpy as np

a = np.random.rand(12)

fig = pyplot.figure()

ax = fig.add_subplot(111)

wdth = 0.20

ind = np.arange(a.size)

mon_ticks =(‘Jan’,‘Feb’,‘Mar’,‘Apr’,‘May’,‘Jun’,‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’,

‘Nov’,‘Dec’)

ax.bar(ind, a, wdth, color=‘0.8’)

ax.set_xticks(ind)

ax.set_xticklabels(mon_ticks)

pyplot.show()

Then pressing apply removes the ticks and tick label setting.

Hopefully this is adressed in the bug report you mention. Thanks.

bevan j wrote:

Sorry if it has already been reported I searched in the bug reports for
qt4agg and didn't find anything. Although I may have been looking in the
wrong place.
I have also noticed that editing some parameters (or pressing apply
without any changes) alters others. For instance if I have:
from matplotlib import pyplot
import numpy as np

a = np.random.rand(12)

fig = pyplot.figure()
ax = fig.add_subplot(111)
wdth = 0.20
ind = np.arange(a.size)
mon_ticks =('Jan','Feb','Mar','Apr','May','Jun','Jul', 'Aug', 'Sep',
'Oct', 'Nov','Dec')
ax.bar(ind, a, wdth, color='0.8')
ax.set_xticks(ind)
ax.set_xticklabels(mon_ticks)
pyplot.show()
Then pressing apply removes the ticks and tick label setting.

Hopefully this is adressed in the bug report you mention. Thanks.

@bevan j: nothing wrong with reporting bugs that should have been solved
long ago.
Patches that correct the issues you mentioned initially have indeed been
submitted, but have not be included in matplotlib as of yet. >> Look in
patches at the mpl tracker.

The last issue with the tick labels on the other hand is more difficult.
Please note that Tick labels are not supported by figure_options currently.
If you haven't changed any settings that make your ticks go away, it would
be possible to ensure your plot is not messed up by qt4_editor when you
click apply/OK, but this feature has not been implemented yet.

···

--
View this message in context: http://old.nabble.com/Qt4Agg-backend---edit-curves-and-axis-parameters-tp29754925p29765678.html
Sent from the matplotlib - users mailing list archive at Nabble.com.