mplot3d FAQ#

How is mplot3d different from Mayavi?#

Mayavi is a very powerful and featureful 3D graphing library. For advanced3D scenes and excellent rendering capabilities, it is highly recommended touse Mayavi.

mplot3d was intended to allow users to create simple 3D graphs with the same"look-and-feel" as matplotlib's 2D plots. Furthermore, users can use the sametoolkit that they are already familiar with to generate both their 2D and 3Dplots.

My 3D plot doesn't look right at certain viewing angles#

This is probably the most commonly reported issue with mplot3d. The problemis that -- from some viewing angles -- a 3D object would appear in frontof another object, even though it is physically behind it. This can result inplots that do not look "physically correct."

Unfortunately, while some work is being done to reduce the occurrence of thisartifact, it is currently an intractable problem, and cannot be fully solveduntil matplotlib supports 3D graphics rendering at its core.

The problem occurs due to the reduction of 3D data down to 2D + z-orderscalar. A single value represents the 3rd dimension for all parts of 3Dobjects in a collection. Therefore, when the bounding boxes of two collectionsintersect, it becomes possible for this artifact to occur. Furthermore, theintersection of two 3D objects (such as polygons or patches) cannot berendered properly in matplotlib's 2D rendering engine.

This problem will likely not be solved until OpenGL support is added to all ofthe backends (patches are greatly welcomed). Until then, if you need complex3D scenes, we recommend usingMayavi.

I don't like how the 3D plot is laid out, how do I change that?#

Historically, mplot3d has suffered from a hard-coding of parameters usedto control visuals such as label spacing, tick length, and grid line width.Work is being done to eliminate this issue. For matplotlib v1.1.0, there isa semi-official manner to modify these parameters. See the note in themplot3d.axis3d section of the mplot3d API documentation formore information.