Commit 7606df69 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

improve the imshow function to return the output of plt.imshow

parent 1d649cba
Pipeline #8463 passed with stages
in 12 minutes and 15 seconds
......@@ -16,9 +16,8 @@ def to_matplotlib(img):
import numpy as np
if img.ndim == 3:
return np.moveaxis(img, 0, -1)
return img
img = np.moveaxis(img, 0, -1)
return img
def imshow(img, cmap=None, **kwargs):
......@@ -38,4 +37,4 @@ def imshow(img, cmap=None, **kwargs):
if cmap is None and img.ndim == 2:
cmap = 'gray'
plt.imshow(to_matplotlib(img), cmap=cmap, **kwargs)
return plt.imshow(to_matplotlib(img), cmap=cmap, **kwargs)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment