mpl_toolkits.mplot3d#

The mplot3d toolkit adds simple 3D plotting capabilities (scatter, surface,line, mesh, etc.) to Matplotlib by supplying an Axes object that can createa 2D projection of a 3D scene. The resulting graph will have the same lookand feel as regular 2D plots. Not the fastest or most feature complete 3Dlibrary out there, but it ships with Matplotlib and thus may be a lighterweight solution for some use cases.

See themplot3d tutorial formore information.

../../_images/demo_mplot3d.png

The interactive backends also provide the ability to rotate and zoom the 3Dscene. One can rotate the 3D scene by simply clicking-and-dragging the scene.Panning is done by clicking the middle mouse button, and zooming is done byright-clicking the scene and dragging the mouse up and down. Unlike 2D plots,the toolbar pan and zoom buttons are not used.

Note

pyplot cannot be used to add content to 3D plots, because its functionsignatures are strictly 2D and cannot handle the additional informationneeded for 3D. Instead, use the explicit API by calling the respectivemethods on theAxes3D object.

axes3d#

Note

3D plotting in Matplotlib is still not as mature as the 2D case.Please report any functions that do not behave as expected as a bug.In addition, help and patches would be greatly appreciated!

axes3d.Axes3D (fig[, rect, elev, azim, roll, ...]) 3D Axes object.

axis3d#

Note

Seempl_toolkits.mplot3d.axis3d._axinfo for a dictionary containingconstants that may be modified for controlling the look and feelof mplot3d axes (e.g., label spacing, font colors and panel colors).Historically, axis3d has suffered from having hard-coded constantsthat precluded user adjustments, and this dictionary was implementedin version 1.1 as a stop-gap measure.

axis3d.Axis(axes, *[, rotate_label])

An Axis class for the 3D plots.

art3d#

art3d.Line3D(xs, ys, zs, *args[, axlim_clip])

3D line object.

art3d.Line3DCollection(lines[, axlim_clip])

A collection of 3D lines.

art3d.Patch3D(*args[, zs, zdir, axlim_clip])

3D patch object.

art3d.Patch3DCollection(*args[, zs, zdir, ...])

A collection of 3D patches.

art3d.Path3DCollection(*args[, zs, zdir, ...])

A collection of 3D paths.

art3d.PathPatch3D(path, *[, zs, zdir, ...])

3D PathPatch object.

art3d.Poly3DCollection(verts, *args[, ...])

A collection of 3D polygons.

art3d.Text3D([x, y, z, text, zdir, axlim_clip])

Text object with 3D position and direction.

art3d.get_dir_vector(zdir)

Return a direction vector.

art3d.juggle_axes(xs, ys, zs, zdir)

Reorder coordinates so that 2Dxs,ys can be plotted in the plane orthogonal tozdir.

art3d.line_2d_to_3d(line[, zs, zdir, axlim_clip])

Convert aLine2D to aLine3D object.

art3d.line_collection_2d_to_3d(col[, zs, ...])

Convert aLineCollection to aLine3DCollection object.

art3d.patch_2d_to_3d(patch[, z, zdir, ...])

Convert aPatch to aPatch3D object.

art3d.patch_collection_2d_to_3d(col[, zs, ...])

Convert aPatchCollection into aPatch3DCollection object (or aPathCollection into aPath3DCollection object).

art3d.pathpatch_2d_to_3d(pathpatch[, z, zdir])

Convert aPathPatch to aPathPatch3D object.

art3d.poly_collection_2d_to_3d(col[, zs, ...])

Convert aPolyCollection into aPoly3DCollection object.

art3d.rotate_axes(xs, ys, zs, zdir)

Reorder coordinates so that the axes are rotated withzdir along the original z axis.

art3d.text_2d_to_3d(obj[, z, zdir, axlim_clip])

Convert aText to aText3D object.

proj3d#

proj3d.inv_transform(xs, ys, zs, invM)

Transform the points by the inverse of the projection matrix,invM.

proj3d.proj_transform(xs, ys, zs, M)

Transform the points by the projection matrixM.

proj3d.proj_transform_clip(xs, ys, zs, M)

[Deprecated]

proj3d.world_transformation(xmin, xmax, ...)

Produce a matrix that scales homogeneous coords in the specified ranges to [0, 1], or [0, pb_aspect[i]] if the plotbox aspect ratio is specified.