Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Views: 21
Image: 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