【发布时间】:2020-01-05 04:22:45
【问题描述】:
我正在使用 Matplotlib 在右侧绘制带有颜色条的散点图。颜色栏的标签与刻度重叠/太接近。
我使用了以下代码。
plt.figure(figsize=(10,10))
plt.title('Spatio-temporal variations of Mean Absolute Error',fontsize=15)
plt.scatter(df['longitude'], df['latitude'], c = df['mean_abs_error'], cmap = 'rainbow')
plt.ylabel('Longitude', fontsize = 15)
plt.xlabel('Latitude', fontsize = 15)
plt.xticks(fontsize = 15)
plt.yticks(fontsize = 15)
plt.colorbar().ax.set_ylabel('Mean Absolute Error', rotation=270, fontsize = 15)
我希望颜色条“平均绝对误差”的标签稍微靠右一点,即在轴刻度和轴标签之间引入一些间距。
【问题讨论】:
标签: python matplotlib colorbar