Skip to content

Instantly share code, notes, and snippets.

@hiepph
Last active June 8, 2020 09:30
Show Gist options
  • Save hiepph/dc6f3aa00714a75a0968b66f0bbf149f to your computer and use it in GitHub Desktop.
Save hiepph/dc6f3aa00714a75a0968b66f0bbf149f to your computer and use it in GitHub Desktop.
jupyter tricks
def display(img):
"Display single image"
_, ax = plt.subplots(1, 1, figsize=(10, 10))
#plt.axis('off')
#plt.title('Title')
plt.imshow(img); plt.show()
def display_grid(imgs):
"Display grid"
n_row = 5
n_col = 10
_, axs = plt.subplots(n_row, n_col, figsize=(20, 20))
axs = axs.flatten()
for i in range(len(axs)):
#axs[i].axis('off')
#axs[i].title.set_text('title')
axs[i].imshow(imgs[i])
plt.show()
%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment