staircase.core.arrays.accessor.StairsAccessor.plot#
- StairsAccessor.plot(ax=None, **kwargs)#
Plots a collection of
Stairs
instances to a single axes- Parameters:
- ax
matplotlib.axes.Axes
, optional If supplied will plot to this axes
- labelsarray-like, optional
Used to label each step function. Use ax.legend() to show.
- **kwargs
Additional parameters are the same as those for
staircase.Stairs.plot()
.
- ax
- Returns:
Examples
>>> import staircase as sc >>> import matplotlib.pyplot as plt
>>> stairs = pd.Series([s2, s3], dtype="Stairs") >>> _, ax = plt.subplots(figsize=(4,3)) >>> stairs.sc.plot(ax) >>> ax.legend()
>>> stairs = pd.Series([s2, s3], index=["s2", "s3"], dtype="Stairs") >>> _, ax = plt.subplots(figsize=(4,3)) >>> stairs.sc.plot(ax) >>> ax.legend()