Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Removing Line2D is broken #4966

Copy link
Copy link
Closed
Closed
Copy link
@WeatherGod

Description

@WeatherGod
Issue body actions

I have been trying out all of my code examples from my book against master to find any additional bugs. I came across this one in chapter 2 where I set up an example for selecting and removing Line2D objects from a plot. Doing so now causes this traceback:

ben@tigger:~/Documents/InteractiveMPL$ python chp2/track_deleter.py 
Traceback (most recent call last):
  File "/home/ben/miniconda/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/backends/backend_qt5.py", line 314, in keyPressEvent
    FigureCanvasBase.key_press_event(self, key, guiEvent=event)
  File "/home/ben/miniconda/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/backend_bases.py", line 1846, in key_press_event
    self.callbacks.process(s, event)
  File "/home/ben/miniconda/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/cbook.py", line 562, in process
    proxy(*args, **kwargs)
  File "/home/ben/miniconda/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/cbook.py", line 429, in __call__
    return mtd(*args, **kwargs)
  File "chp2/track_deleter.py", line 32, in keypress
    self.selected.remove()
  File "/home/ben/miniconda/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/artist.py", line 159, in remove
    self.axes = None
  File "/home/ben/miniconda/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/lines.py", line 572, in axes
    if ax.xaxis is not None:
AttributeError: 'NoneType' object has no attribute 'xaxis'

Essentially, calling Line2D.axes = None as part of the remove process is triggering its property setter, and that property setter is assuming that an Axes object is always passed in.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.