Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,6 @@ def __init__(self, xdata, ydata,

self.set_data(xdata, ydata)

def __getstate__(self):
state = super(Line2D, self).__getstate__()
# _linefunc will be restored on draw time.
state.pop('_lineFunc', None)
return state

def contains(self, mouseevent):
"""
Test whether the mouse event occurred on the line. The pick
Expand Down Expand Up @@ -784,7 +778,7 @@ def draw(self, renderer):
if funcname != '_draw_nothing':
tpath, affine = transf_path.get_transformed_path_and_affine()
if len(tpath.vertices):
self._lineFunc = getattr(self, funcname)
line_func = getattr(self, funcname)
gc = renderer.new_gc()
self._set_gc_clip(gc)

Expand All @@ -807,7 +801,7 @@ def draw(self, renderer):
if self.get_sketch_params() is not None:
gc.set_sketch_params(*self.get_sketch_params())

self._draw_lines(renderer, gc, tpath, affine.frozen())
line_func(renderer, gc, tpath, affine.frozen())
gc.restore()

if self._marker and self._markersize > 0:
Expand Down Expand Up @@ -1250,9 +1244,6 @@ def set_dashes(self, seq):
else:
self.set_linestyle((0, seq))

def _draw_lines(self, renderer, gc, path, trans):
self._lineFunc(renderer, gc, path, trans)

def _draw_solid(self, renderer, gc, path, trans):
gc.set_linestyle('solid')
gc.set_dashes(self._dashOffset, self._dashSeq)
Expand Down
14 changes: 0 additions & 14 deletions lib/matplotlib/tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,6 @@ def test_image():
pickle.dump(fig, BytesIO())


@cleanup
def test_grid():
from matplotlib.backends.backend_agg import new_figure_manager
manager = new_figure_manager(1000)
fig = manager.canvas.figure
ax = fig.add_subplot(1, 1, 1)
ax.grid()
# Drawing the grid triggers instance methods to be attached
# to the Line2D object (_lineFunc).
manager.canvas.draw()

pickle.dump(ax, BytesIO())


@cleanup
def test_polar():
ax = plt.subplot(111, polar=True)
Expand Down