MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_data

Method set_data

lib/matplotlib/image.py:1136–1158  ·  view source on GitHub ↗

Set the grid for the pixel centers, and the pixel values. Parameters ---------- x, y : 1D array-like Monotonic arrays of shapes (N,) and (M,), respectively, specifying pixel centers. A : array-like (M, N) `~numpy.ndarray`

(self, x, y, A)

Source from the content-addressed store, hash-verified

1134 return im, l, b, IdentityTransform()
1135
1136 def set_data(self, x, y, A):
1137 """
1138 Set the grid for the pixel centers, and the pixel values.
1139
1140 Parameters
1141 ----------
1142 x, y : 1D array-like
1143 Monotonic arrays of shapes (N,) and (M,), respectively, specifying
1144 pixel centers.
1145 A : array-like
1146 (M, N) `~numpy.ndarray` or masked array of values to be
1147 colormapped, or (M, N, 3) RGB array, or (M, N, 4) RGBA array.
1148 """
1149 A = self._normalize_image_array(A)
1150 x = np.array(x, np.float32)
1151 y = np.array(y, np.float32)
1152 if not (x.ndim == y.ndim == 1 and A.shape[:2] == y.shape + x.shape):
1153 raise TypeError("Axes don't match array shape")
1154 self._A = A
1155 self._Ax = x
1156 self._Ay = y
1157 self._imcache = None
1158 self.stale = True
1159
1160 def set_array(self, *args):
1161 raise NotImplementedError('Method not supported')

Callers 3

test_nonuniform_logscaleFunction · 0.95

Calls 1

Tested by 3

test_nonuniform_logscaleFunction · 0.76