diff --git a/galleries/examples/images_contours_and_fields/image_nonuniform.py b/galleries/examples/images_contours_and_fields/image_nonuniform.py index 629f37bf61d5..337ec60f9531 100644 --- a/galleries/examples/images_contours_and_fields/image_nonuniform.py +++ b/galleries/examples/images_contours_and_fields/image_nonuniform.py @@ -3,9 +3,12 @@ Image nonuniform ================ -This illustrates the NonUniformImage class. It is not -available via an Axes method, but it is easily added to an -Axes instance as shown here. +`.NonUniformImage` is a generalized image with pixels on a rectilinear grid, +i.e. it allows rows and columns with individual heights / widths. + +There is no high-level plotting method on `.Axes` or `pyplot` to create a +NonUniformImage. Instead, you have to instantiate the image explicitly and +add it to the Axes using `.Axes.add_image`. """ import matplotlib.pyplot as plt diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 3d94d90708f3..3231c2a1d913 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -808,7 +808,7 @@ def get_filterrad(self): class AxesImage(_ImageBase): """ - An image attached to an Axes. + An image, i.e. data on a regular grid, attached to an Axes. Parameters ---------- @@ -995,6 +995,14 @@ def get_cursor_data(self, event): class NonUniformImage(AxesImage): + """ + An image with pixels on a rectilinear grid. + + In contrast to `.AxesImage`, where pixels are on a regular grid, + NonUniformImage allows rows and columns with individual heights / widths. + + See also :doc:`/gallery/images_contours_and_fields/image_nonuniform`. + """ def __init__(self, ax, *, interpolation='nearest', **kwargs): """