staircase.plot#

staircase.plot(collection, ax=None, **kwargs)#

Plots a collection of Stairs instances to a single axes

Parameters
collectionarray-like, dictionary or pandas.Series

The Stairs instances at which to evaluate

axmatplotlib.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().

Returns
matplotlib.axes.Axes

Examples

>>> import staircase as sc
>>> import matplotlib.pyplot as plt
>>> stairs = [s2, s3]
>>> _, ax = plt.subplots(figsize=(4,3))
>>> sc.plot(stairs, ax), 
>>> ax.legend()
../../_images/staircase-plot-1.png
>>> stairs = {"s1":s1, "s2":s2}
>>> _, ax = plt.subplots(figsize=(4,3))
>>> sc.plot(stairs, ax)
>>> ax.legend()
../../_images/staircase-plot-2.png