Convert a `.PolyCollection` into a `.Poly3DCollection` object. Parameters ---------- col : `~matplotlib.collections.PolyCollection` The collection to convert. zs : float or array of floats The location or locations to place the polygons in the collection along
(col, zs=0, zdir='z', axlim_clip=False)
| 1553 | |
| 1554 | |
| 1555 | def poly_collection_2d_to_3d(col, zs=0, zdir='z', axlim_clip=False): |
| 1556 | """ |
| 1557 | Convert a `.PolyCollection` into a `.Poly3DCollection` object. |
| 1558 | |
| 1559 | Parameters |
| 1560 | ---------- |
| 1561 | col : `~matplotlib.collections.PolyCollection` |
| 1562 | The collection to convert. |
| 1563 | zs : float or array of floats |
| 1564 | The location or locations to place the polygons in the collection along |
| 1565 | the *zdir* axis. Default: 0. |
| 1566 | zdir : {'x', 'y', 'z'} |
| 1567 | The axis in which to place the patches. Default: 'z'. |
| 1568 | See `.get_dir_vector` for a description of the values. |
| 1569 | """ |
| 1570 | segments_3d, codes = _paths_to_3d_segments_with_codes( |
| 1571 | col.get_paths(), zs, zdir) |
| 1572 | col.__class__ = Poly3DCollection |
| 1573 | col.set_verts_and_codes(segments_3d, codes) |
| 1574 | col.set_3d_properties() |
| 1575 | col._axlim_clip = axlim_clip |
| 1576 | |
| 1577 | |
| 1578 | def juggle_axes(xs, ys, zs, zdir): |
nothing calls this directly
no test coverage detected
searching dependent graphs…