@@ -217,109 +217,6 @@ def test_hatching():
217
217
ax .legend (handlelength = 4 , handleheight = 4 )
218
218
219
219
220
- @image_comparison (baseline_images = ['legend_annotation_empty' ],
221
- extensions = ['png' ],
222
- style = 'mpl20' )
223
- def test_legend_empty_annotation ():
224
- # Related to issue 8236
225
- # Tests empty annotations showing up in legend
226
- fig , ax = plt .subplots (1 )
227
- ax .set_xticklabels ('' )
228
- ax .set_yticklabels ('' )
229
- ax .annotate ("" ,
230
- xy = (0.1 , 0.5 ),
231
- xytext = (0.1 , 0.5 ),
232
- label = 'annotation (empty)' )
233
- ax .legend ()
234
-
235
-
236
- @image_comparison (baseline_images = ['legend_annotation_text' ],
237
- extensions = ['png' ],
238
- style = 'mpl20' )
239
- def test_legend_text_annotation ():
240
- # Related to issue 8236
241
- # Tests text annotations showing up in legend
242
- fig , ax = plt .subplots (1 )
243
- ax .set_xticklabels ('' )
244
- ax .set_yticklabels ('' )
245
- my_annotation = ax .annotate ("X" ,
246
- xy = (0.1 , 0.5 ),
247
- xytext = (0.1 , 0.5 ),
248
- color = 'C2' ,
249
- label = 'annotation (text, no arrow)' )
250
- ax .legend (handler_map = {my_annotation : HandlerAnnotation (rep_str = 'Abcde' ,
251
- rep_maxlen = 0 )})
252
-
253
-
254
- @image_comparison (baseline_images = ['legend_annotation_arrow' ],
255
- extensions = ['png' ],
256
- style = 'mpl20' )
257
- def test_legend_arrow_annotation ():
258
- # Related to issue 8236
259
- # Tests arrow annotations showing up in legend
260
- fig , ax = plt .subplots (1 )
261
- ax .set_xticklabels ('' )
262
- ax .set_yticklabels ('' )
263
- ax .plot ([0 , 1 ], [0 , 0 ], label = 'line1' )
264
- ax .plot ([0 , 1 ], [1 , 1 ], label = 'line2' )
265
- ax .annotate ("" ,
266
- xy = (0.3 , 1.0 ),
267
- xytext = (0.3 , 0.0 ),
268
- arrowprops = {'arrowstyle' : '<->' , 'color' : 'C7' },
269
- label = 'annotation (no text, arrow)' )
270
- ax .legend ()
271
-
272
-
273
- @image_comparison (baseline_images = ['legend_fancy_arrow' ],
274
- extensions = ['png' ],
275
- style = 'mpl20' )
276
- def test_legend_fancy_arrow_annotation ():
277
- # Related to issue 8236
278
- # Tests arrow annotations showing up in legend
279
- fig , ax = plt .subplots (1 )
280
- ax .set_xticklabels ('' )
281
- ax .set_yticklabels ('' )
282
- arrpatch = mpatches .FancyArrowPatch ([0.5 , 0.8 ], [0.9 , 0.9 ],
283
- arrowstyle = '<|-' ,
284
- mutation_scale = 20 ,
285
- color = 'C3' ,
286
- label = 'arrowpatch' )
287
- ax .add_patch (arrpatch )
288
- ax .legend ()
289
-
290
-
291
- @image_comparison (baseline_images = ['legend_text' ],
292
- extensions = ['png' ],
293
- style = 'mpl20' )
294
- def test_legend_text ():
295
- # Related to issue 8236
296
- # Tests text showing up in legend
297
- fig , ax = plt .subplots (1 )
298
- ax .set_xticklabels ('' )
299
- ax .set_yticklabels ('' )
300
- ax .text (x = 0.1 , y = 0.1 ,
301
- s = 'Hello' ,
302
- color = 'C5' ,
303
- label = 'text' )
304
- ax .legend ()
305
-
306
-
307
- @image_comparison (baseline_images = ['legend_short_text' ],
308
- extensions = ['png' ],
309
- style = 'mpl20' )
310
- def test_legend_short_text ():
311
- # Related to issue 8236
312
- # Tests short text showing up in legend
313
- fig , ax = plt .subplots ()
314
- ax .set_xticklabels ('' )
315
- ax .set_yticklabels ('' )
316
- ax .text (x = 0.1 , y = 0.2 ,
317
- s = 'Z' ,
318
- color = 'C0' ,
319
- label = 'short text' )
320
- ax .legend ()
321
-
322
-
323
220
@image_comparison (baseline_images = ['legend_all_annotation_text' ],
324
221
extensions = ['png' ],
325
222
style = 'mpl20' )
0 commit comments