python matplotlib 警告 MatplotlibDeprecationWarning: shading=‘flat‘ ... is deprecate

plt.pcolormesh(x1,x2,grid_hat,cmap=cm_light)
  • 报警告

MatplotlibDeprecationWarning: shading=‘flat’ when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading=‘auto’, ‘nearest’ or ‘gouraud’, or set rcParams[‘pcolor.shading’]. This will become an error two minor releases later.
plt.pcolormesh(x1,x2,grid_hat,cmap=cm_light)

  • 原因
    shading默认值为‘flat’,3.3版本之后,当X,Y,C参数维度相同时反对使用’flat’
  • 解决
plt.pcolormesh(x1,x2,grid_hat,shading='auto',cmap=cm_light)

posted on 2022-04-11 22:38  路过君  阅读(54)  评论(0编辑  收藏  举报

导航