MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_stem3d

Function test_stem3d

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

Source from the content-addressed store, hash-verified

1743@image_comparison(['stem3d.png'], style='mpl20',
1744 tol=0 if platform.machine() == 'x86_64' else 0.008)
1745def test_stem3d():
1746 fig, axs = plt.subplots(2, 3, figsize=(8, 6),
1747 constrained_layout=True,
1748 subplot_kw={'projection': '3d'})
1749
1750 theta = np.linspace(0, 2*np.pi)
1751 x = np.cos(theta - np.pi/2)
1752 y = np.sin(theta - np.pi/2)
1753 z = theta
1754
1755 for ax, zdir in zip(axs[0], ['x', 'y', 'z']):
1756 ax.stem(x, y, z, orientation=zdir)
1757 ax.set_title(f'orientation={zdir}')
1758
1759 x = np.linspace(-np.pi/2, np.pi/2, 20)
1760 y = np.ones_like(x)
1761 z = np.cos(x)
1762
1763 for ax, zdir in zip(axs[1], ['x', 'y', 'z']):
1764 markerline, stemlines, baseline = ax.stem(
1765 x, y, z,
1766 linefmt='C4-.', markerfmt='C1D', basefmt='C2',
1767 orientation=zdir)
1768 ax.set_title(f'orientation={zdir}')
1769 markerline.set(markerfacecolor='none', markeredgewidth=2)
1770 baseline.set_linewidth(3)
1771
1772
1773@image_comparison(["equal_box_aspect.png"], style="mpl20")

Callers

nothing calls this directly

Calls 5

subplotsMethod · 0.45
stemMethod · 0.45
set_titleMethod · 0.45
setMethod · 0.45
set_linewidthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…