您可以使用 matplotlib 创建子图结构,然后将带有 geopandas/pysal 的图添加到特定的子图:
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]`
Run Code Online (Sandbox Code Playgroud)
小智 5
为了并排获得两个 geopandas 地图,您可以编写:
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)
Run Code Online (Sandbox Code Playgroud)