MCPcopy Create free account
hub / github.com/matplotlib/matplotlib / _test_proj_draw_axes

Function _test_proj_draw_axes

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:1218–1232  ·  view source on GitHub ↗
(M, s=1, *args, **kwargs)

Source from the content-addressed store, hash-verified

1216
1217
1218def _test_proj_draw_axes(M, s=1, *args, **kwargs):
1219 xs = [0, s, 0, 0]
1220 ys = [0, 0, s, 0]
1221 zs = [0, 0, 0, s]
1222 txs, tys, tzs = proj3d.proj_transform(xs, ys, zs, M)
1223 o, ax, ay, az = zip(txs, tys)
1224 lines = [(o, ax), (o, ay), (o, az)]
1225
1226 fig, ax = plt.subplots(*args, **kwargs)
1227 linec = LineCollection(lines)
1228 ax.add_collection(linec, autolim="_datalim_only")
1229 for x, y, t in zip(txs, tys, ['o', 'x', 'y', 'z']):
1230 ax.text(x, y, t)
1231
1232 return fig, ax
1233
1234
1235@mpl3d_image_comparison(['proj3d_axes_cube.png'], style='mpl20')

Callers 2

test_proj_axes_cubeFunction · 0.85

Calls 4

LineCollectionClass · 0.90
add_collectionMethod · 0.80
subplotsMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…