Skip to content
Snippets Groups Projects
Commit c0a0417c authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch 'p-1' into 'master'

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

See merge request !25
parents 1d649cba 7606df69
No related branches found
No related tags found
1 merge request!25improve the imshow function to return the output of plt.imshow
Pipeline #
...@@ -16,9 +16,8 @@ def to_matplotlib(img): ...@@ -16,9 +16,8 @@ def to_matplotlib(img):
import numpy as np import numpy as np
if img.ndim == 3: if img.ndim == 3:
return np.moveaxis(img, 0, -1) img = np.moveaxis(img, 0, -1)
else: return img
return img
def imshow(img, cmap=None, **kwargs): def imshow(img, cmap=None, **kwargs):
...@@ -38,4 +37,4 @@ def imshow(img, cmap=None, **kwargs): ...@@ -38,4 +37,4 @@ def imshow(img, cmap=None, **kwargs):
if cmap is None and img.ndim == 2: if cmap is None and img.ndim == 2:
cmap = 'gray' cmap = 'gray'
plt.imshow(to_matplotlib(img), cmap=cmap, **kwargs) return plt.imshow(to_matplotlib(img), cmap=cmap, **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment