Skip to content

Commit 174fc94

Browse files
committed
Merge pull request #4264 from olanmatt/fix_4068
BUG : Fix for unpickling polar plot closes #4068
2 parents b605fc6 + e807fd7 commit 174fc94

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/matplotlib/projections/polar.py

-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ def get_matrix(self):
112112
return self._mtx
113113
get_matrix.__doc__ = Affine2DBase.get_matrix.__doc__
114114

115-
def __getstate__(self):
116-
return {}
117-
118115

119116
class InvertedPolarTransform(Transform):
120117
"""

lib/matplotlib/tests/test_pickle.py

+15
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def test_simple():
126126
pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL)
127127

128128

129+
@cleanup
129130
@image_comparison(baseline_images=['multi_pickle'],
130131
extensions=['png'], remove_text=True)
131132
def test_complete():
@@ -194,6 +195,7 @@ def test_complete():
194195
assert_equal(fig.get_label(), 'Figure with a label?')
195196

196197

198+
@cleanup
197199
def test_no_pyplot():
198200
# tests pickle-ability of a figure not created with pyplot
199201
from matplotlib.backends.backend_pdf import FigureCanvasPdf as fc
@@ -206,12 +208,14 @@ def test_no_pyplot():
206208
pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL)
207209

208210

211+
@cleanup
209212
def test_renderer():
210213
from matplotlib.backends.backend_agg import RendererAgg
211214
renderer = RendererAgg(10, 20, 30)
212215
pickle.dump(renderer, BytesIO())
213216

214217

218+
@cleanup
215219
def test_image():
216220
# Prior to v1.4.0 the Image would cache data which was not picklable
217221
# once it had been drawn.
@@ -224,6 +228,7 @@ def test_image():
224228
pickle.dump(fig, BytesIO())
225229

226230

231+
@cleanup
227232
def test_grid():
228233
from matplotlib.backends.backend_agg import new_figure_manager
229234
manager = new_figure_manager(1000)
@@ -237,6 +242,16 @@ def test_grid():
237242
pickle.dump(ax, BytesIO())
238243

239244

245+
@cleanup
246+
def test_polar():
247+
ax = plt.subplot(111, polar=True)
248+
fig = plt.gcf()
249+
result = BytesIO()
250+
pf = pickle.dumps(fig)
251+
pickle.loads(pf)
252+
plt.draw()
253+
254+
240255
if __name__ == '__main__':
241256
import nose
242257
nose.runmodule(argv=['-s'])

0 commit comments

Comments
 (0)