Skip to content

Commit 75c425c

Browse files
authored
Merge pull request #20238 from timhoffm/doc-set_array
Clarify docstring of ScalarMappable.set/get_array()
2 parents 0554030 + 729f92d commit 75c425c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/matplotlib/cm.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,15 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
361361

362362
def set_array(self, A):
363363
"""
364-
Set the image array from array-like *A*.
364+
Set the value array from array-like *A*.
365365
366366
Parameters
367367
----------
368368
A : array-like or None
369+
The values that are mapped to colors.
370+
371+
The base class `.ScalarMappable` does not make any assumptions on
372+
the dimensionality and shape of the value array *A*.
369373
"""
370374
if A is None:
371375
self._A = None
@@ -379,7 +383,12 @@ def set_array(self, A):
379383
self._A = A
380384

381385
def get_array(self):
382-
"""Return the data array."""
386+
"""
387+
Return the array of values, that are mapped to colors.
388+
389+
The base class `.ScalarMappable` does not make any assumptions on
390+
the dimensionality and shape of the array.
391+
"""
383392
return self._A
384393

385394
def get_cmap(self):

0 commit comments

Comments
 (0)