I want to plot two tematic maps side by side to compare then. I am using geopandas to plot the maps and pysal to generate the maps from spatial analysis.
You can create the subplots structure with matplotlib, and then add the plots with geopandas/pysal to the specific subplot:
import matplotlib.pyplot as plt
fig, axes = plt.subplots(ncols=2)
# add geopandas plot to left subplot
geodataframe.plot(..., ax=axes[0])
# add pysal plot to right subplot using `axes[1]`
In order to get two geopandas maps side by side, you can write:
fig, (ax1,ax2) = plt.subplots(nrows=1, ncols=2, figsize=(20, 16))
ax1 = geodataframe.plot(ax=ax1, column='obs', legend=True)
ax2 = geodataframe.plot(ax=ax2, column='pred', legend=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With