Plot a 3D wireframe. .. note:: The *rcount* and *ccount* kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers
(self, X, Y, Z, *, axlim_clip=False, **kwargs)
| 2573 | return polyc |
| 2574 | |
| 2575 | def plot_wireframe(self, X, Y, Z, *, axlim_clip=False, **kwargs): |
| 2576 | """ |
| 2577 | Plot a 3D wireframe. |
| 2578 | |
| 2579 | .. note:: |
| 2580 | |
| 2581 | The *rcount* and *ccount* kwargs, which both default to 50, |
| 2582 | determine the maximum number of samples used in each direction. If |
| 2583 | the input data is larger, it will be downsampled (by slicing) to |
| 2584 | these numbers of points. |
| 2585 | |
| 2586 | Parameters |
| 2587 | ---------- |
| 2588 | X, Y, Z : 2D arrays |
| 2589 | Data values. |
| 2590 | |
| 2591 | axlim_clip : bool, default: False |
| 2592 | Whether to hide lines and patches with vertices outside the axes |
| 2593 | view limits. |
| 2594 | |
| 2595 | .. versionadded:: 3.10 |
| 2596 | |
| 2597 | rcount, ccount : int |
| 2598 | Maximum number of samples used in each direction. If the input |
| 2599 | data is larger, it will be downsampled (by slicing) to these |
| 2600 | numbers of points. Setting a count to zero causes the data to be |
| 2601 | not sampled in the corresponding direction, producing a 3D line |
| 2602 | plot rather than a wireframe plot. Defaults to 50. |
| 2603 | |
| 2604 | rstride, cstride : int |
| 2605 | Downsampling stride in each direction. These arguments are |
| 2606 | mutually exclusive with *rcount* and *ccount*. If only one of |
| 2607 | *rstride* or *cstride* is set, the other defaults to 1. Setting a |
| 2608 | stride to zero causes the data to be not sampled in the |
| 2609 | corresponding direction, producing a 3D line plot rather than a |
| 2610 | wireframe plot. |
| 2611 | |
| 2612 | 'classic' mode uses a default of ``rstride = cstride = 1`` instead |
| 2613 | of the new default of ``rcount = ccount = 50``. |
| 2614 | |
| 2615 | **kwargs |
| 2616 | Other keyword arguments are forwarded to `.Line3DCollection`. |
| 2617 | """ |
| 2618 | |
| 2619 | had_data = self.has_data() |
| 2620 | if Z.ndim != 2: |
| 2621 | raise ValueError("Argument Z must be 2-dimensional.") |
| 2622 | # FIXME: Support masked arrays |
| 2623 | X, Y, Z = np.broadcast_arrays(X, Y, Z) |
| 2624 | rows, cols = Z.shape |
| 2625 | |
| 2626 | has_stride = 'rstride' in kwargs or 'cstride' in kwargs |
| 2627 | has_count = 'rcount' in kwargs or 'ccount' in kwargs |
| 2628 | |
| 2629 | if has_stride and has_count: |
| 2630 | raise ValueError("Cannot specify both stride and count arguments") |
| 2631 | |
| 2632 | rstride = kwargs.pop('rstride', 1) |