From 1c6ad283f7537bed068e4dec20cd746d68dac483 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Fri, 9 Oct 2020 21:08:59 -0700 Subject: [PATCH] Backport PR #18700: clarify example in plot docstring --- lib/matplotlib/axes/_axes.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 7018bbb3626d..0e634e006cdd 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -1566,10 +1566,14 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs): directly to *x*, *y*. A separate data set will be drawn for every column. - Example: an array ``a`` where the first column represents the *x* - values and the other columns are the *y* columns:: + Example: For an array ``a`` with shape (N, m) calling:: - >>> plot(a[0], a[1:]) + >>> plot(a) + + is equivalent to: + + >>> for i in range(m): + ... plot(a[:, i]) - The third way is to specify multiple sets of *[x]*, *y*, *[fmt]* groups::