()
| 646 | |
| 647 | |
| 648 | def test_annotationbbox_gid(): |
| 649 | # Test that object gid appears in the AnnotationBbox |
| 650 | # in output svg. |
| 651 | fig = plt.figure() |
| 652 | ax = fig.add_subplot() |
| 653 | arr_img = np.ones((32, 32)) |
| 654 | xy = (0.3, 0.55) |
| 655 | |
| 656 | imagebox = OffsetImage(arr_img, zoom=0.1) |
| 657 | imagebox.image.axes = ax |
| 658 | |
| 659 | ab = AnnotationBbox(imagebox, xy, |
| 660 | xybox=(120., -80.), |
| 661 | xycoords='data', |
| 662 | boxcoords="offset points", |
| 663 | pad=0.5, |
| 664 | arrowprops=dict( |
| 665 | arrowstyle="->", |
| 666 | connectionstyle="angle,angleA=0,angleB=90,rad=3") |
| 667 | ) |
| 668 | ab.set_gid("a test for issue 20044") |
| 669 | ax.add_artist(ab) |
| 670 | |
| 671 | with BytesIO() as fd: |
| 672 | fig.savefig(fd, format='svg') |
| 673 | buf = fd.getvalue().decode('utf-8') |
| 674 | |
| 675 | expected = '<g id="a test for issue 20044">' |
| 676 | assert expected in buf |
| 677 | |
| 678 | |
| 679 | def test_svgid(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…