()
| 757 | |
| 758 | @mpl3d_image_comparison(['text3d.png'], remove_text=False, style='mpl20') |
| 759 | def test_text3d(): |
| 760 | fig = plt.figure() |
| 761 | ax = fig.add_subplot(projection='3d') |
| 762 | |
| 763 | zdirs = (None, 'x', 'y', 'z', (1, 1, 0), (1, 1, 1)) |
| 764 | xs = (2, 6, 4, 9, 7, 2) |
| 765 | ys = (6, 4, 8, 7, 2, 2) |
| 766 | zs = (4, 2, 5, 6, 1, 7) |
| 767 | |
| 768 | for zdir, x, y, z in zip(zdirs, xs, ys, zs): |
| 769 | label = '(%d, %d, %d), dir=%s' % (x, y, z, zdir) |
| 770 | ax.text(x, y, z, label, zdir) |
| 771 | |
| 772 | ax.text(1, 1, 1, "red", color='red') |
| 773 | ax.text2D(0.05, 0.95, "2D Text", transform=ax.transAxes) |
| 774 | plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated |
| 775 | ax.set_xlim3d(0, 10) |
| 776 | ax.set_ylim3d(0, 10) |
| 777 | ax.set_zlim3d(0, 10) |
| 778 | ax.set_xlabel('X axis') |
| 779 | ax.set_ylabel('Y axis') |
| 780 | ax.set_zlabel('Z axis') |
| 781 | |
| 782 | |
| 783 | @check_figures_equal() |
nothing calls this directly
no test coverage detected
searching dependent graphs…