Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6882b72

Browse filesBrowse files
tacaswellmeeseeksmachine
authored andcommitted
Backport PR #16648: Document filling of Poly3DCollection
1 parent ae85a8c commit 6882b72
Copy full SHA for 6882b72

File tree

Expand file treeCollapse file tree

1 file changed

+28
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+28
-6
lines changed

‎lib/mpl_toolkits/mplot3d/art3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/art3d.py
+28-6Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,17 +580,39 @@ def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True):
580580
class Poly3DCollection(PolyCollection):
581581
"""
582582
A collection of 3D polygons.
583+
584+
.. note::
585+
**Filling of 3D polygons**
586+
587+
There is no simple definition of the enclosed surface of a 3D polygon
588+
unless the polygon is planar.
589+
590+
In practice, Matplotlib performs the filling on the 2D projection of
591+
the polygon. This gives a correct filling appearance only for planar
592+
polygons. For all other polygons, you'll find orientations in which
593+
the edges of the polygon intersect in the projection. This will lead
594+
to an incorrect visualization of the 3D area.
595+
596+
If you need filled areas, it is recommended to create them via
597+
`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`, which creates a
598+
triangulation and thus generates consistent surfaces.
583599
"""
584600

585601
def __init__(self, verts, *args, zsort='average', **kwargs):
586602
"""
587-
Create a Poly3DCollection.
588-
589-
*verts* should contain 3D coordinates.
590-
591-
Keyword arguments:
592-
zsort, see set_zsort for options.
603+
Parameters
604+
----------
605+
verts : list of array-like Nx3
606+
Each element describes a polygon as a sequnce of ``N_i`` points
607+
``(x, y, z)``.
608+
zsort : {'average', 'min', 'max'}, default: 'average'
609+
The calculation method for the z-order.
610+
See `~.Poly3DCollection.set_zsort` for details.
611+
*args, **kwargs
612+
All other parameters are forwarded to `.PolyCollection`.
593613
614+
Notes
615+
-----
594616
Note that this class does a bit of magic with the _facecolors
595617
and _edgecolors properties.
596618
"""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.