We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59bfcfa commit 703343eCopy full SHA for 703343e
lib/matplotlib/collections.py
@@ -849,6 +849,23 @@ def set_alpha(self, alpha):
849
850
set_alpha.__doc__ = artist.Artist._set_alpha_for_array.__doc__
851
852
+ def set_array(self, A):
853
+ """
854
+ Set the image array.
855
+
856
+ Parameters
857
+ ----------
858
+ A : array-like
859
860
+ # This method overrides the inherited
861
+ # cm.ScalarMappable.set_array method
862
+ self._A = cbook.safe_masked_invalid(A, copy=True)
863
864
+ if (self._A.dtype != np.uint8 and
865
+ not np.can_cast(self._A.dtype, float, "same_kind")):
866
+ raise TypeError("Image data of dtype {} cannot be converted to "
867
+ "float".format(self._A.dtype))
868
869
def get_linewidth(self):
870
return self._linewidths
871
0 commit comments