Commit c0a0417c authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'p-1' into 'master'

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

See merge request !25
parents 1d649cba 7606df69
Pipeline #8464 passed with stages
in 9 minutes and 1 second
......@@ -16,9 +16,8 @@ def to_matplotlib(img):
import numpy as np
if img.ndim == 3:
return np.moveaxis(img, 0, -1)
else:
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
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment