Skip to content

Instantly share code, notes, and snippets.

View wybert's full-sized avatar
🏠
Working from home

Xiaokang Fu wybert

🏠
Working from home
View GitHub Profile
@wybert
wybert / disp_multiple_images.py
Created November 16, 2018 10:13 — forked from soply/disp_multiple_images.py
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@wybert
wybert / thumb_grid.py
Created November 16, 2018 10:13 — forked from lebedov/thumb_grid.py
Display a grid of thumbnails.
#!/usr/bin/env python
"""
Display a grid of thumbnails.
"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
import numpy as np
import PIL