- 积分
- 67324
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-23
- 最后登录
- 1970-1-1
|
发表于 2024-12-26 09:04:50
|
显示全部楼层
本帖最后由 edwardli 于 2024-12-26 09:24 编辑
正解可能如此:
pcolormesh有一个关键字参数clim,控制了colormap的阈值。如果 *vmin* 或 *vmax* 为 None,则将分别使用图像最小值/最大值进行颜色缩放。
但是,contourf没有这个关键字。
One thing to be aware of when using this limits, however, is how contourf() and pcolormesh() differ using clim or vmin/vmax. With pcolormesh(), the colormap limits will always be set based on the clim values. With contourf(), if clim or vmin/vmax values are given without contour levels, the levels will be automatically chosen, but the color limits will be correct. For example, if your data goes outside the clim range, the default colorbar will too, but all the levels outside the color limits will still be drawn - they will just be the same color. |
|