Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b894683

Browse files
committed
Improve make_image docstring
1 parent e2b2bbe commit b894683

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/matplotlib/image.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,24 +228,28 @@ def changed(self):
228228
def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
229229
unsampled=False, round_to_pixel_border=True):
230230
"""
231-
Normalize, rescale and color the image to the given in_bbox
232-
(in data space), to the given out_bbox (in pixel space)
233-
clipped to the given clip_bbox (also in pixel space), and
234-
magnified by the magnification factor.
231+
Normalize, rescale and color the image `A` to the given
232+
in_bbox (in data space), to the given out_bbox (in pixel
233+
space) clipped to the given clip_bbox (also in pixel space),
234+
and magnified by the magnification factor.
235+
236+
`A` may be a greyscale image (MxN) with a dtype of `float32`,
237+
`float64`, `uint16` or `uint8`, or an RGBA image (MxNx4) with
238+
a dtype of `float32`, `float64`, or `uint8`.
235239
236240
If `unsampled` is True, the image will not be scaled, but an
237241
appropriate affine transformation will be returned instead.
238242
239243
If `round_to_pixel_border` is True, the output image size will
240244
be rounded to the nearest pixel boundary. This makes the
241-
images align correctly with the axes. It should not be use in
242-
cases where you want exact scaling, however, such as
245+
images align correctly with the axes. It should not be used
246+
in cases where you want exact scaling, however, such as
243247
FigureImage.
244248
245249
Returns the resulting (image, x, y, trans), where (x, y) is
246250
the upper left corner of the result in pixel space, and
247251
`trans` is the affine transformation from the image to pixel
248-
space if the image data itself was not resampled.
252+
space.
249253
"""
250254
if A is None:
251255
raise RuntimeError('You must first set the image'

0 commit comments

Comments
 (0)