Created
March 9, 2018 15:22
-
-
Save DanHickstein/7b5ef8e8b244b0f05832141972126fc3 to your computer and use it in GitHub Desktop.
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
import numpy as np | |
import scipy.ndimage | |
import matplotlib.pyplot as plt | |
before = np.zeros((10,10)) | |
before[5] = 1 | |
# after = np.rot90(before) # uncomment to switch to np.rot90s | |
after = scipy.ndimage.interpolation.rotate(before, 45) | |
fig, axs = plt.subplots(1, 2, figsize=(8,4)) | |
axs[0].imshow(before) | |
axs[1].imshow(after) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment