Last active
December 29, 2019 08:54
-
-
Save avlakin/c6bdbd600836183f98f15603573ac351 to your computer and use it in GitHub Desktop.
Easy plot multiple images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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