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

Function collection_2d_to_3d

lib/mpl_toolkits/mplot3d/art3d.py:471–481  ·  view source on GitHub ↗

Convert a `.Collection` to a `.Collection3D` object.

(col, zs=0, zdir='z', axlim_clip=False)

Source from the content-addressed store, hash-verified

469
470
471def collection_2d_to_3d(col, zs=0, zdir='z', axlim_clip=False):
472 """Convert a `.Collection` to a `.Collection3D` object."""
473 zs = np.broadcast_to(zs, len(col.get_paths()))
474 col._3dverts_codes = [
475 (np.column_stack(juggle_axes(
476 *np.column_stack([p.vertices, np.broadcast_to(z, len(p.vertices))]).T,
477 zdir)),
478 p.codes)
479 for p, z in zip(col.get_paths(), zs)]
480 col.__class__ = cbook._make_class_factory(Collection3D, "{}3D")(type(col))
481 col._axlim_clip = axlim_clip
482
483
484class Line3DCollection(LineCollection):

Callers

nothing calls this directly

Calls 2

juggle_axesFunction · 0.85
get_pathsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…