I'm using the function imshow
from matplotlib
to display several rasters using faceting.
I need to overlay the vector vec.shp on each raster in each facet.
I would prefere to do this with matplotlib
and imshow
due to the easiness of coding
import matplotlib.pyplot as plt
import gdal
import geopandas as gpd
raster1 = gdal.Open("/path/file1.tif")
raster1 = gdal.Open("/path/file2.tif")
raster1 = gdal.Open("/path/file3.tif")
# etc
vector = gpd.read_file("/path/vec.shp")
# plot 1
plt.subplot(2, 4, 1)
plt.imshow(raster1)
# plot 2
plt.subplot(2, 4, 2)
plt.imshow(raster2)
# plot 3
plt.subplot(2, 4, 3)
plt.imshow(raster3)
# etc
I'm wondering wether is there a syntax like this
# plot 1
plt.subplot(2, 4, 1)
plt.imshow(raster1, vector)
Best Answer