Merge pull request #1281 from blink1073/fix-imshow

Create a new figure for imshow if necessary
This commit is contained in:
Stefan van der Walt
2014-12-13 19:42:29 +02:00
+2
View File
@@ -2,6 +2,8 @@ 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)