%matplotlib inline
!curl https://data.geo.admin.ch/ch.swisstopo.swissimage-dop10/swissimage-dop10_2020_2533-1152/swissimage-dop10_2020_2533-1152_0.1_2056.tif --output image.tif
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 57.7M 100 57.7M 0 0 8354k 0 0:00:07 0:00:07 --:--:-- 9067k
import matplotlib.pyplot as plt
import rasterio as rio
from rasterio import plot
dst_filepath = "foo.png"
fig, ax = plt.subplots()
with rio.open("image.tif") as src:
plot.show(src.read(window=((6700, 8000), (1300, 3000))))
fig.savefig(dst_filepath)