Merge pull request #18870 from aitikgupta/scalarmappable-set_array · matplotlib/matplotlib@a18b4bf · GitHub
Skip to content

Commit a18b4bf

Browse files
authored
Merge pull request #18870 from aitikgupta/scalarmappable-set_array
Expand ScalarMappable.set_array to accept array-like inputs
2 parents 4c5eff9 + 0ec672f commit a18b4bf

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

lib/matplotlib/cm.py

Lines changed: 11 additions & 2 deletions

lib/matplotlib/image.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,7 @@ def make_image(self, renderer, magnification=1.0, unsampled=False):
13461346

13471347
def set_data(self, A):
13481348
"""Set the image array."""
1349-
cm.ScalarMappable.set_array(self,
1350-
cbook.safe_masked_invalid(A, copy=True))
1349+
cm.ScalarMappable.set_array(self, A)
13511350
self.stale = True
13521351

13531352

lib/matplotlib/tests/test_collections.py

Lines changed: 16 additions & 0 deletions

0 commit comments

Comments
 (0)