Created
November 20, 2020 03:58
-
-
Save rhoit/fb81df2927c131b026fdbc3fc0a3f1ea to your computer and use it in GitHub Desktop.
This file contains 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
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