Draw a stepwise constant function as a line or a filled plot. *edges* define the x-axis positions of the steps. *values* the function values between these steps. Depending on *fill*, the function is drawn either as a continuous line with vertical segments at the edg
(self, values, edges=None, *,
orientation='vertical', baseline=0, fill=False, **kwargs)
| 7689 | |
| 7690 | @_preprocess_data() |
| 7691 | def stairs(self, values, edges=None, *, |
| 7692 | orientation='vertical', baseline=0, fill=False, **kwargs): |
| 7693 | """ |
| 7694 | Draw a stepwise constant function as a line or a filled plot. |
| 7695 | |
| 7696 | *edges* define the x-axis positions of the steps. *values* the function values |
| 7697 | between these steps. Depending on *fill*, the function is drawn either as a |
| 7698 | continuous line with vertical segments at the edges, or as a filled area. |
| 7699 | |
| 7700 | Parameters |
| 7701 | ---------- |
| 7702 | values : array-like |
| 7703 | The step heights. |
| 7704 | |
| 7705 | edges : array-like |
| 7706 | The step positions, with ``len(edges) == len(vals) + 1``, |
| 7707 | between which the curve takes on vals values. |
| 7708 | |
| 7709 | orientation : {'vertical', 'horizontal'}, default: 'vertical' |
| 7710 | The direction of the steps. Vertical means that *values* are along |
| 7711 | the y-axis, and edges are along the x-axis. |
| 7712 | |
| 7713 | baseline : float, array-like or None, default: 0 |
| 7714 | The bottom value of the bounding edges or when |
| 7715 | ``fill=True``, position of lower edge. If *fill* is |
| 7716 | True or an array is passed to *baseline*, a closed |
| 7717 | path is drawn. |
| 7718 | |
| 7719 | If None, then drawn as an unclosed Path. |
| 7720 | |
| 7721 | fill : bool, default: False |
| 7722 | Whether the area under the step curve should be filled. |
| 7723 | |
| 7724 | Passing both ``fill=True` and ``baseline=None`` will likely result in |
| 7725 | undesired filling: the first and last points will be connected |
| 7726 | with a straight line and the fill will be between this line and the stairs. |
| 7727 | |
| 7728 | |
| 7729 | Returns |
| 7730 | ------- |
| 7731 | StepPatch : `~matplotlib.patches.StepPatch` |
| 7732 | |
| 7733 | Other Parameters |
| 7734 | ---------------- |
| 7735 | data : indexable object, optional |
| 7736 | DATA_PARAMETER_PLACEHOLDER |
| 7737 | |
| 7738 | **kwargs |
| 7739 | `~matplotlib.patches.StepPatch` properties |
| 7740 | |
| 7741 | """ |
| 7742 | |
| 7743 | if 'color' in kwargs: |
| 7744 | _color = kwargs.pop('color') |
| 7745 | else: |
| 7746 | _color = self._get_lines.get_next_color() |
| 7747 | if fill: |
| 7748 | kwargs.setdefault('linewidth', 0) |