prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug: io.imshow() and io.show() do not work as expected in winows
  In my win7-x64 environemnt, io.imshow() and io.show() do not work as expected. I use  io.imshow() to show mutiple images, and when I call io.show() to show all the images, only the last image shows. In linux, it works well and all the images will show when I call io.show()
  
  
  </issue>
  <code>
  [start of skimage/io/_plugins/matplotlib_plugin.py]
  1 import matplotlib.pyplot as plt
  2 
  3 
  4 def imshow(*args, **kwargs):
  5     kwargs.setdefault('interpolation', 'nearest')
  6     kwargs.setdefault('cmap', 'gray')
  7     plt.imshow(*args, **kwargs)
  8 
  9 imread = plt.imread
  10 show = plt.show
  11 
  12 
  13 def _app_show():
  14     show()
  15
  [end of skimage/io/_plugins/matplotlib_plugin.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/skimage/io/_plugins/matplotlib_plugin.py b/skimage/io/_plugins/matplotlib_plugin.py
  --- a/skimage/io/_plugins/matplotlib_plugin.py
  +++ b/skimage/io/_plugins/matplotlib_plugin.py
  @@ -2,6 +2,8 @@
   
   
   def imshow(*args, **kwargs):
  +    if plt.gca().has_data():
  +        plt.figure()
       kwargs.setdefault('interpolation', 'nearest')
       kwargs.setdefault('cmap', 'gray')
       plt.imshow(*args, **kwargs)
  
verification_info: {"golden_diff": "diff --git a/skimage/io/_plugins/matplotlib_plugin.py b/skimage/io/_plugins/matplotlib_plugin.py\n--- a/skimage/io/_plugins/matplotlib_plugin.py\n+++ b/skimage/io/_plugins/matplotlib_plugin.py\n@@ -2,6 +2,8 @@\n \n \n def imshow(*args, **kwargs):\n+    if plt.gca().has_data():\n+        plt.figure()\n     kwargs.setdefault('interpolation', 'nearest')\n     kwargs.setdefault('cmap', 'gray')\n     plt.imshow(*args, **kwargs)\n", "issue": "Bug: io.imshow() and io.show() do not work as expected in winows\nIn my win7-x64 environemnt, io.imshow() and io.show() do not work as expected. I use  io.imshow() to show mutiple images, and when I call io.show() to show all the images, only the last image shows. In linux, it works well and all the images will show when I call io.show()\n\n", "before_files": [{"content": "import matplotlib.pyplot as plt\n\n\ndef imshow(*args, **kwargs):\n    kwargs.setdefault('interpolation', 'nearest')\n    kwargs.setdefault('cmap', 'gray')\n    plt.imshow(*args, **kwargs)\n\nimread = plt.imread\nshow = plt.show\n\n\ndef _app_show():\n    show()\n", "path": "skimage/io/_plugins/matplotlib_plugin.py"}]}