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: 32
Image: ubuntu2004
Kernel: Python 3 (system-wide)
import numpy as np import matplotlib.pyplot as plt
picture = plt.imread('DSCF0867.JPG')
plt.imshow(picture)
<matplotlib.image.AxesImage at 0x7fb637860c40>
Image in a Jupyter notebook
picture_2 = np.array(picture) picture_2[:,:,:] = picture_2[::-1,::-1,::] plt.imshow(picture_2)
<matplotlib.image.AxesImage at 0x7fb631542670>
Image in a Jupyter notebook

The code above is the 180 degree rotation of the first image. You take the original image and you take the second to last value with -1. This then rotates your image and you get picture_2.