-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Document filling of Poly3DCollection #16648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -530,17 +530,39 @@ def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True): | |
class Poly3DCollection(PolyCollection): | ||
""" | ||
A collection of 3D polygons. | ||
|
||
.. note:: | ||
**Filling of 3D polygons** | ||
|
||
There is no simple definition of the enclosed surface of a 3D polygon | ||
unless the polygon is planar. | ||
|
||
In practice, Matplotlib performs the filling on the 2D projection of | ||
the polygon. This gives a correct filling appearance only for planar | ||
polygons. For all other polygons, you'll find orientations in which | ||
the edges of the polygon intersect in the projection. This will lead | ||
to an incorrect visualization of the 3D area. | ||
|
||
If you need filled areas, it is recommended to create them via | ||
`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`, which creates a | ||
triangulation and thus generates consistent surfaces. | ||
""" | ||
|
||
def __init__(self, verts, *args, zsort='average', **kwargs): | ||
""" | ||
Create a Poly3DCollection. | ||
|
||
*verts* should contain 3D coordinates. | ||
|
||
Keyword arguments: | ||
zsort, see set_zsort for options. | ||
Parameters | ||
---------- | ||
verts : list of array-like Nx3 | ||
Each element describes a polygon as a sequnce of ``N_i`` points | ||
``(x, y, z)``. | ||
zsort : {'average', 'min', 'max'}, default: 'average' | ||
The calculation method for the z-order. | ||
See `~.Poly3DCollection.set_zsort` for details. | ||
*args, **kwargs | ||
All other parameters are forwarded to `.PolyCollection`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a "sphinx thing". But there is documentation on it in the matplotlib dev guide: https://matplotlib.org/devdocs/devel/documenting_mpl.html#referring-to-other-code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Notes | ||
----- | ||
Note that this class does a bit of magic with the _facecolors | ||
and _edgecolors properties. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just write
.Axes3D.plot_trisurf
(or~.Axes3D.plot_trisurf
).Can self-merge with or without that change.