@@ -107,6 +107,8 @@ def test_simple():
107
107
plt .plot (list (xrange (10 )), label = 'foobar' )
108
108
plt .legend ()
109
109
110
+ # Uncomment to debug any unpicklable objects. This is slow so is not
111
+ # uncommented by default.
110
112
# recursive_pickle(fig)
111
113
pickle .dump (ax , BytesIO (), pickle .HIGHEST_PROTOCOL )
112
114
@@ -217,12 +219,25 @@ def test_image():
217
219
from matplotlib .backends .backend_agg import new_figure_manager
218
220
manager = new_figure_manager (1000 )
219
221
fig = manager .canvas .figure
220
- ax = fig .add_subplot (1 ,1 , 1 )
222
+ ax = fig .add_subplot (1 , 1 , 1 )
221
223
ax .imshow (np .arange (12 ).reshape (3 , 4 ))
222
224
manager .canvas .draw ()
223
225
pickle .dump (fig , BytesIO ())
224
226
225
227
228
+ def test_grid ():
229
+ from matplotlib .backends .backend_agg import new_figure_manager
230
+ manager = new_figure_manager (1000 )
231
+ fig = manager .canvas .figure
232
+ ax = fig .add_subplot (1 , 1 , 1 )
233
+ ax .grid ()
234
+ # Drawing the grid triggers instance methods to be attached
235
+ # to the Line2D object (_lineFunc).
236
+ manager .canvas .draw ()
237
+
238
+ pickle .dump (ax , BytesIO ())
239
+
240
+
226
241
if __name__ == '__main__' :
227
242
import nose
228
243
nose .runmodule (argv = ['-s' ])
0 commit comments