Skip to content

Commit 5b03611

Browse files
authoredAug 3, 2017
Merge pull request #124 from mark-hoffmann/patch-1
Plots update
2 parents 33de96e + d2a894f commit 5b03611

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎deeplearning1/nbs/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ def plots(ims, figsize=(12,6), rows=1, interp=False, titles=None):
8282
if (ims.shape[-1] != 3):
8383
ims = ims.transpose((0,2,3,1))
8484
f = plt.figure(figsize=figsize)
85+
cols = len(ims)//rows if len(ims) % 2 == 0 else len(ims)//rows + 1
8586
for i in range(len(ims)):
86-
sp = f.add_subplot(rows, len(ims)//rows, i+1)
87+
sp = f.add_subplot(rows, cols, i+1)
8788
sp.axis('Off')
8889
if titles is not None:
8990
sp.set_title(titles[i], fontsize=16)

0 commit comments

Comments
 (0)
Please sign in to comment.