Skip to content

Commit b8dbc99

Browse files
timhoffmstory645
andauthored
DOC: Change _make_image signature to numpydoc (matplotlib#28558)
* DOC: Change _make_image signature to numpydoc Minor rewrite. I did this as part of trying to understand the intended behavior. It's still not complete but at least makes it more obvious where information is still sparse. * Update lib/matplotlib/image.py Co-authored-by: hannah <story645@gmail.com> --------- Co-authored-by: hannah <story645@gmail.com>
1 parent 8b33378 commit b8dbc99

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

lib/matplotlib/image.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,33 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
341341
the given *clip_bbox* (also in pixel space), and magnified by the
342342
*magnification* factor.
343343
344-
*A* may be a greyscale image (M, N) with a dtype of `~numpy.float32`,
345-
`~numpy.float64`, `~numpy.float128`, `~numpy.uint16` or `~numpy.uint8`,
346-
or an (M, N, 4) RGBA image with a dtype of `~numpy.float32`,
347-
`~numpy.float64`, `~numpy.float128`, or `~numpy.uint8`.
344+
Parameters
345+
----------
346+
A : ndarray
348347
349-
If *unsampled* is True, the image will not be scaled, but an
350-
appropriate affine transformation will be returned instead.
348+
- a (M, N) array interpreted as scalar (greyscale) image,
349+
with one of the dtypes `~numpy.float32`, `~numpy.float64`,
350+
`~numpy.float128`, `~numpy.uint16` or `~numpy.uint8`.
351+
- (M, N, 4) RGBA image with a dtype of `~numpy.float32`,
352+
`~numpy.float64`, `~numpy.float128`, or `~numpy.uint8`.
353+
354+
in_bbox : `~matplotlib.transforms.Bbox`
355+
356+
out_bbox : `~matplotlib.transforms.Bbox`
357+
358+
clip_bbox : `~matplotlib.transforms.Bbox`
359+
360+
magnification : float, default: 1
361+
362+
unsampled : bool, default: False
363+
If True, the image will not be scaled, but an appropriate
364+
affine transformation will be returned instead.
351365
352-
If *round_to_pixel_border* is True, the output image size will be
353-
rounded to the nearest pixel boundary. This makes the images align
354-
correctly with the Axes. It should not be used if exact scaling is
355-
needed, such as for `FigureImage`.
366+
round_to_pixel_border : bool, default: True
367+
If True, the output image size will be rounded to the nearest pixel
368+
boundary. This makes the images align correctly with the Axes.
369+
It should not be used if exact scaling is needed, such as for
370+
`.FigureImage`.
356371
357372
Returns
358373
-------

0 commit comments

Comments
 (0)