MCPcopy
hub / github.com/matplotlib/matplotlib / test_text3d

Function test_text3d

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:759–780  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

757
758@mpl3d_image_comparison(['text3d.png'], remove_text=False, style='mpl20')
759def 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()

Callers

nothing calls this directly

Calls 6

figureMethod · 0.80
add_subplotMethod · 0.80
set_xlabelMethod · 0.80
set_ylabelMethod · 0.80
set_zlabelMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…