Skip to content

Instantly share code, notes, and snippets.

@rhoit
Created November 20, 2020 03:58
Show Gist options
  • Save rhoit/fb81df2927c131b026fdbc3fc0a3f1ea to your computer and use it in GitHub Desktop.
Save rhoit/fb81df2927c131b026fdbc3fc0a3f1ea to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
methods = [
'none', 'bessel', 'bicubic', 'bilinear', #'antialiased',
'catrom', 'gaussian', 'hamming', 'hanning', 'hermite', 'kaiser',
'lanczos', 'mitchell', 'nearest', 'quadric', 'sinc', 'spline16',
'spline36',
]
np.random.seed(0)
grid = np.random.rand(4, 4)
fig, ax = plt.subplots(3, 6, figsize=(9, 6),
subplot_kw={'xticks': [], 'yticks': []}
)
for sub, name in zip(ax.flat, methods):
sub.imshow(grid, interpolation=name, cmap='viridis')
sub.set_title(name)
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment