FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Edit figure parameters: TypeError: argument 1 has unexpected type 'list' · Issue #1690 · matplotlib/matplotlib · GitHub

Repository navigation

Edit figure parameters: TypeError: argument 1 has unexpected type 'list' #1690

Closed

Description

Using a tuple to designate a single colour in a plot command, like this:

plot(range(10), c=(0.5, 0.5, 0.5))

and then clicking on the "Edit curves line and axes parameter" button raises this TypeError:

Traceback (most recent call last):
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/backend_qt4.py", line 577, in edit_parameters
    figureoptions.figure_edit(axes, self)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/figureoptions.py", line 134, in figure_edit
    icon=get_icon('qt4_editor_options.svg'), apply=apply_callback)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 514, in fedit
    dialog = FormDialog(data, title, comment, icon, parent, apply)
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 431, in __init__
    self.formwidget.setup()
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 403, in setup
    widget.setup()
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 378, in setup
    widget.setup()
  File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 285, in setup
    field.addItems(value)
TypeError: QComboBox.addItems(QStringList): argument 1 has unexpected type 'list'

This is very related to #917.

Activity

  1. mspacek commented on Jan 25, 2013

    ContributorAuthor

    I just discovered that this:

    plot(range(10), range(10), 'k', marker='o', ms=3)

    also raises the exact same traceback and error:

    Traceback (most recent call last):
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/backend_qt4.py", line 577, in edit_parameters
        figureoptions.figure_edit(axes, self)
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/figureoptions.py", line 134, in figure_edit
        icon=get_icon('qt4_editor_options.svg'), apply=apply_callback)
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 514, in fedit
        dialog = FormDialog(data, title, comment, icon, parent, apply)
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 431, in __init__
        self.formwidget.setup()
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 403, in setup
        widget.setup()
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 378, in setup
        widget.setup()
      File "/home/mspacek/src/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py", line 285, in setup
        field.addItems(value)
    TypeError: QComboBox.addItems(QStringList): argument 1 has unexpected type 'list'
    
  2. mspacek commented on Jan 25, 2013

    ContributorAuthor

    However, if I use

    plot(range(10), range(10), 'k-o', ms=3)

    instead, I get the exact same plot, and no error when I click on the "edit curve line and axes parameters button"

  3. efiring commented on Jan 28, 2013

    Member

    Confirmed with v1.2.x. I think this limitation has always been present.

  4. added a commit that references this issue on May 24, 2013
  5. mdboom commented on May 24, 2013

    Member

    Closed by #2017.

  6. mspacek commented on May 24, 2013

    ContributorAuthor

    Thanks! That fixed the TypeError in both cases in the first post. But when I do this:

    plot(range(10), c=(0.5, 0.5, 0.5))
    

    and then click on the "Edit curves line and axes parameter" button, the line and marker colours show up as my default black instead of grey, so the dialog isn't being updated properly. Hitting Apply or OK changes them to black, without me actually changing anything in the dialog. Not a big deal though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL