From 729f92d2b05e283c5db6027cea988f80d67f75da Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 16 May 2021 01:34:04 +0200 Subject: [PATCH] Clarify docstring of ScalarMappable.set/get_array() --- lib/matplotlib/cm.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index bf1f03eb4af8..e05a490e8f7f 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -361,11 +361,15 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True): def set_array(self, A): """ - Set the image array from array-like *A*. + Set the value array from array-like *A*. Parameters ---------- A : array-like or None + The values that are mapped to colors. + + The base class `.ScalarMappable` does not make any assumptions on + the dimensionality and shape of the value array *A*. """ if A is None: self._A = None @@ -379,7 +383,12 @@ def set_array(self, A): self._A = A def get_array(self): - """Return the data array.""" + """ + Return the array of values, that are mapped to colors. + + The base class `.ScalarMappable` does not make any assumptions on + the dimensionality and shape of the array. + """ return self._A def get_cmap(self):