prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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()
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `skimage/io/_plugins/matplotlib_plugin.py`
  Content:
  ```
  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 FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
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"}], "after_files": [{"content": "import matplotlib.pyplot as plt\n\n\ndef 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\nimread = plt.imread\nshow = plt.show\n\n\ndef _app_show():\n    show()\n", "path": "skimage/io/_plugins/matplotlib_plugin.py"}]}