From 439b2c04d9ca34d9408a98146e7dc832c745ff9a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 21 Apr 2021 20:21:08 -0400 Subject: [PATCH] Clarify docs for stackplot. Fixes #20036. --- lib/matplotlib/stackplot.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/stackplot.py b/lib/matplotlib/stackplot.py index 9e8317ec987f..a2e269875346 100644 --- a/lib/matplotlib/stackplot.py +++ b/lib/matplotlib/stackplot.py @@ -41,12 +41,17 @@ def stackplot(axes, x, *args, size of each layer. It is also called 'Streamgraph'-layout. More details can be found at http://leebyron.com/streamgraph/. - labels : Length N list of str - Labels to assign to each data series. + labels : list of str, optional + A sequence of labels to assign to each data series. If unspecified, + then no labels will be applied to artists. - colors : Length N list of color - A list or tuple of colors. These will be cycled through and used to - colour the stacked areas. + colors : list of color, optional + A sequence of colors to be cycled through and used to color the stacked + areas. The sequence need not be exactly the same length as the number + of provided *y*, in which case the colors will repeat from the + beginning. + + If not specified, the colors from the Axes property cycle will be used. **kwargs All other keyword arguments are passed to `.Axes.fill_between`.