Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
51 views
ubuntu2004
Kernel: Python 3 (system-wide)

First, we will implement matplotlib and numpy. Also add the picture.

import matplotlib.pyplot as plt import numpy as np
img = plt.imread("galaxy.png") img.shape
(530, 353, 4)
plt.imshow(img)
<matplotlib.image.AxesImage at 0x7f51d30e7700>
Image in a Jupyter notebook
This way, we will rotate the picture by reversing the colums of arra
img2 = np.array(img) img2[:,:,:] = img2[::-1,::-1,:] plt.imshow(img2)
<matplotlib.image.AxesImage at 0x7f51d30d0b80>
Image in a Jupyter notebook