import matplotlib.pyplot as plt


def imshow(*args, **kwargs):
    if plt.gca().has_data():
        plt.figure()
    kwargs.setdefault('interpolation', 'nearest')
    kwargs.setdefault('cmap', 'gray')
    plt.imshow(*args, **kwargs)

imread = plt.imread
show = plt.show


def _app_show():
    show()

import matplotlib.pyplot as plt


def imshow(im, *args, **kwargs):
    """Show the input image and return the current axes.

    Parameters
    ----------
    im : array, shape (M, N[, 3])
        The image to display.

    *args, **kwargs : positional and keyword arguments
        These are passed directly to `matplotlib.pyplot.imshow`.

    Returns
    -------
    ax : `matplotlib.pyplot.Axes`
        The axes showing the image.
    """
    if plt.gca().has_data():
        plt.figure()
    kwargs.setdefault('interpolation', 'nearest')
    kwargs.setdefault('cmap', 'gray')
    return plt.imshow(im, *args, **kwargs)

imread = plt.imread
show = plt.show


def _app_show():
    show()

Add docstring to matplotlib imshow plugin
Add docstring to matplotlib imshow plugin

The image is now named as an argument, and the axes are returned, in
keeping with matplotlib convention.

  import matplotlib.pyplot as plt
  
  
- def imshow(*args, **kwargs):
+ def imshow(im, *args, **kwargs):
+     """Show the input image and return the current axes.
+ 
+     Parameters
+     ----------
+     im : array, shape (M, N[, 3])
+         The image to display.
+ 
+     *args, **kwargs : positional and keyword arguments
+         These are passed directly to `matplotlib.pyplot.imshow`.
+ 
+     Returns
+     -------
+     ax : `matplotlib.pyplot.Axes`
+         The axes showing the image.
+     """
      if plt.gca().has_data():
          plt.figure()
      kwargs.setdefault('interpolation', 'nearest')
      kwargs.setdefault('cmap', 'gray')
-     plt.imshow(*args, **kwargs)
+     return plt.imshow(im, *args, **kwargs)
  
  imread = plt.imread
  show = plt.show
  
  
  def _app_show():
      show()
  
Add docstring to matplotlib imshow plugin
## Code Before:
import matplotlib.pyplot as plt


def imshow(*args, **kwargs):
    if plt.gca().has_data():
        plt.figure()
    kwargs.setdefault('interpolation', 'nearest')
    kwargs.setdefault('cmap', 'gray')
    plt.imshow(*args, **kwargs)

imread = plt.imread
show = plt.show


def _app_show():
    show()

## Instruction:
Add docstring to matplotlib imshow plugin
## Code After:
import matplotlib.pyplot as plt


def imshow(im, *args, **kwargs):
    """Show the input image and return the current axes.

    Parameters
    ----------
    im : array, shape (M, N[, 3])
        The image to display.

    *args, **kwargs : positional and keyword arguments
        These are passed directly to `matplotlib.pyplot.imshow`.

    Returns
    -------
    ax : `matplotlib.pyplot.Axes`
        The axes showing the image.
    """
    if plt.gca().has_data():
        plt.figure()
    kwargs.setdefault('interpolation', 'nearest')
    kwargs.setdefault('cmap', 'gray')
    return plt.imshow(im, *args, **kwargs)

imread = plt.imread
show = plt.show


def _app_show():
    show()
