Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 592818a

Browse files
committed
Merge pull request #4264 from olanmatt/fix_4068
BUG : Fix for unpickling polar plot closes #4068
1 parent 3f03e2e commit 592818a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 0 additions & 3 deletions
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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def test_simple():
127127
pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL)
128128

129129

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

197198

199+
@cleanup
198200
def test_no_pyplot():
199201
# tests pickle-ability of a figure not created with pyplot
200202
from matplotlib.backends.backend_pdf import FigureCanvasPdf as fc
@@ -207,12 +209,14 @@ def test_no_pyplot():
207209
pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL)
208210

209211

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

215218

219+
@cleanup
216220
def test_image():
217221
# Prior to v1.4.0 the Image would cache data which was not picklable
218222
# once it had been drawn.
@@ -225,6 +229,7 @@ def test_image():
225229
pickle.dump(fig, BytesIO())
226230

227231

232+
@cleanup
228233
def test_grid():
229234
from matplotlib.backends.backend_agg import new_figure_manager
230235
manager = new_figure_manager(1000)
@@ -238,6 +243,16 @@ def test_grid():
238243
pickle.dump(ax, BytesIO())
239244

240245

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

0 commit comments

Comments
 (0)