我正在尝试使用geopandas和seaborn绘制地图。我的问题是颜色图例的高度超出了我图形的高度。如何控制其方向,高度,宽度等,以避免出现此问题?
这是我的代码:
import numpy as np
fig,axes = plt.subplots(nrows=2,ncols=2, figsize=(6.2,6),dpi=600)
cols = cresult.columns[1:5]
cols = np.array(cols)
cols=cols.reshape(2,2)
title = np.array(['(a)','(b)','(c)','(d)']).reshape(2,2)
sns.set(context='paper', style='ticks',)
for i in range(2):
for j in range(2):
btnshp.plot(ax=axes[i,j], color='w', edgecolor='black')
Gcresult.plot(ax=axes[i,j], label=cols[i,j], column=cols[i,j],
cmap='viridis', markersize=15,legend=True)
axes[i,j].set_xlabel(title[i,j])
plt.tight_layout()
到目前为止,这是我所能看到的,您可以看到颜色图例对于地图而言太大: