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 fills the 2D projection of the polygon. This gives a corre
| 1227 | |
| 1228 | |
| 1229 | class Poly3DCollection(PolyCollection): |
| 1230 | """ |
| 1231 | A collection of 3D polygons. |
| 1232 | |
| 1233 | .. note:: |
| 1234 | **Filling of 3D polygons** |
| 1235 | |
| 1236 | There is no simple definition of the enclosed surface of a 3D polygon |
| 1237 | unless the polygon is planar. |
| 1238 | |
| 1239 | In practice, Matplotlib fills the 2D projection of the polygon. This |
| 1240 | gives a correct filling appearance only for planar polygons. For all |
| 1241 | other polygons, you'll find orientations in which the edges of the |
| 1242 | polygon intersect in the projection. This will lead to an incorrect |
| 1243 | visualization of the 3D area. |
| 1244 | |
| 1245 | If you need filled areas, it is recommended to create them via |
| 1246 | `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`, which creates a |
| 1247 | triangulation and thus generates consistent surfaces. |
| 1248 | """ |
| 1249 | |
| 1250 | def __init__(self, verts, *args, zsort='average', shade=False, |
| 1251 | lightsource=None, axlim_clip=False, **kwargs): |
| 1252 | """ |
| 1253 | Parameters |
| 1254 | ---------- |
| 1255 | verts : list of (N, 3) array-like |
| 1256 | The sequence of polygons [*verts0*, *verts1*, ...] where each |
| 1257 | element *verts_i* defines the vertices of polygon *i* as a 2D |
| 1258 | array-like of shape (N, 3). |
| 1259 | zsort : {'average', 'min', 'max'}, default: 'average' |
| 1260 | The calculation method for the z-order. |
| 1261 | See `~.Poly3DCollection.set_zsort` for details. |
| 1262 | shade : bool, default: False |
| 1263 | Whether to shade *facecolors* and *edgecolors*. When activating |
| 1264 | *shade*, *facecolors* and/or *edgecolors* must be provided. |
| 1265 | |
| 1266 | .. versionadded:: 3.7 |
| 1267 | |
| 1268 | lightsource : `~matplotlib.colors.LightSource`, optional |
| 1269 | The lightsource to use when *shade* is True. |
| 1270 | |
| 1271 | .. versionadded:: 3.7 |
| 1272 | |
| 1273 | axlim_clip : bool, default: False |
| 1274 | Whether to hide polygons with a vertex outside the view limits. |
| 1275 | |
| 1276 | .. versionadded:: 3.10 |
| 1277 | |
| 1278 | *args, **kwargs |
| 1279 | All other parameters are forwarded to `.PolyCollection`. |
| 1280 | |
| 1281 | Notes |
| 1282 | ----- |
| 1283 | Note that this class does a bit of magic with the _facecolors |
| 1284 | and _edgecolors properties. |
| 1285 | """ |
| 1286 | if shade: |
no outgoing calls
searching dependent graphs…