Skip to content

Instantly share code, notes, and snippets.

@avlakin
Last active December 29, 2019 08:54
Show Gist options
  • Select an option

  • Save avlakin/c6bdbd600836183f98f15603573ac351 to your computer and use it in GitHub Desktop.

Select an option

Save avlakin/c6bdbd600836183f98f15603573ac351 to your computer and use it in GitHub Desktop.
Easy plot multiple images
def plt_gen(cols, nrows=1, figsize=[20,5]):
plt.clf()
fig, ax = plt.subplots(nrows=nrows, ncols=cols, figsize=figsize)
for i, axi in enumerate(ax.flat):
axi.set_title(i)
yield i, axi, lambda img: axi.imshow(img, cmap='gray', vmin=0, vmax=1)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment