Python:matplotlib.cm 色表
官网:Choosing Colormaps in Matplotlib — Matplotlib 3.5.0 documentation
Colormap与matplotlib.cm
我们以等高区域函数contourf为例,介绍matplotlib.cm的用法。关于contourf各参数的具体用法,这里不多说,有需要可以参考Python:matplotlib.pyplot - ShineLe - 博客园
plt.contourf( X , Y , Z,...,cmap=? )
在用contourf绘制等值区域时,cmap参数指定了色表样式,它有两种写法——str或Colormap实例,举例来说:
plt.contourf( X , Y , Z,...,cmap='hot' )
#等价于
plt.contourf( X , Y , Z,...,cmap=matplotlib.cm.hot)
以上都是用同一个colormap进行等值区域绘制的,结果如下:

这就是colormap的用法。而matplotlib.cm中提供许多colormap,足够我们日常工作学习需要。
matplotlib.cm中的色表
官网:Colormap reference — Matplotlib 3.5.0 documentation
使用时,在需要填入colormap的地方,可以通过两种写法使用colormap,①字符串形式的色表名:'hot';②matplotlib.cm.色表名:matplotlib.cm.hot。
cm中的色表罗列如下:







Python:matplotlib.cm 色表的更多相关文章
- python+matplotlib 绘制等高线
python+matplotlib 绘制等高线 步骤有七: 有一个m*n维的矩阵(data),其元素的值代表高度 构造两个向量:x(1*n)和y(1*m).这两个向量用来构造网格坐标矩阵(网格坐标矩阵 ...
- python matplotlib.pyplot 散点图详解(2)
python matplotlib.pyplot 散点图详解(2) 上期资料 一.散点图叠加 可以用多个scatter函数叠加散点图 代码如下: import matplotlib.pyplot as ...
- python matplotlib 中文显示参数设置
python matplotlib 中文显示参数设置 方法一:每次编写代码时进行参数设置 #coding:utf-8import matplotlib.pyplot as pltplt.rcParam ...
- python matplotlib plot 数据中的中文无法正常显示的解决办法
转发自:http://blog.csdn.net/laoyaotask/article/details/22117745?utm_source=tuicool python matplotlib pl ...
- python matplotlib画图产生的Type 3 fonts字体没有嵌入问题
ScholarOne's 对python matplotlib画图产生的Type 3 fonts字体不兼容,更改措施: 在程序中添加如下语句 import matplotlib matplotlib. ...
- 使用Python matplotlib做动态曲线
今天看到“Python实时监控CPU使用率”的教程: https://www.w3cschool.cn/python3/python3-ja3d2z2g.html 自己也学习如何使用Python ma ...
- python matplotlib 中文显示乱码设置
python matplotlib 中文显示乱码设置 原因:是matplotlib库中没有中文字体.1 解决方案:1.进入C:\Anaconda64\Lib\site-packages\matplot ...
- Python - matplotlib 数据可视化
在许多实际问题中,经常要对给出的数据进行可视化,便于观察. 今天专门针对Python中的数据可视化模块--matplotlib这块内容系统的整理,方便查找使用. 本文来自于对<利用python进 ...
- 转:使用 python Matplotlib 库 绘图 及 相关问题
使用 python Matplotlib 库绘图 转:http://blog.csdn.net/daniel_ustc/article/details/9714163 Matplotlib ...
随机推荐
- Kubernetes 证书默认1年过期时间修改
使用过的kubeadm搭建K8s集群的朋友知道,默认自动生成的证书有效期只有 1 年,因此需要每年手动更新一次证书,这种形式显然对实际生产环境来说很不友好:因此下面教给大家修改这个过期时间的终极方法. ...
- 如何美化 Matplotlib 的工具栏和绘图风格
前言 matplotlib 功能十分强大,就是工具栏丑了点.忍了一个学期之后,还是决定自己动手,魔改一波 matplotlib 的工具栏样式.同时给大家分享一下自己按照 MATLAB 写的 matpl ...
- 计算机电子书 2018 BiliDrive 备份
下载方式 根据你的操作系统下载不同的 BiliDrive 二进制. 执行: bilidrive download <link> 链接 文档 链接 Webpack 中文指南.epub (40 ...
- Android生成xml
XmlSerializer //使用XmlSerializer来序列化xml文件 public static boolean backupSms_android(Context con ...
- js正则表达式 未提交进行验证
转载请注明来源:https://www.cnblogs.com/hookjc/ function SetInputMust(){ /*var varr=idstr.split(','); idstr ...
- PHP中常见的数字掐头去尾操作方法
四舍五入round round( float $val[, int $precision = 0[, int $mode = PHP_ROUND_HALF_UP]] ) : float 对浮点数进行四 ...
- 调试程序Bug-陈棚
1.使用NSAssert 主要可以作为自定义bug的返回信息,对调试极为方便知道bug出现在哪 NSAssert()只是一个宏,用于开发阶段调试程序中的Bug,通过为NSAssert()传递条件表达式 ...
- array_intersect_key 取得需要字段 用法
$need_key = [ 'hash' => 0 ]; $parma = array_intersect_key( $parmas, $need_key );
- Mac搭建Git服务器—开启SSH
SSH开启 在osx中开启ssh访问非常简单,只需要打开"系统偏好设置"并且点击"共享"图标即可. 选中下图中的check box即允许远程登陆.server处 ...
- Linux远程访问及控制
Linux远程访问及控制 目录 Linux远程访问及控制 一.SSH远程管理 1. SSH远程管理概述 2. OpenSSH概述 3. 配置OpenSSH服务端 4. sshd服务的验证方式 5. 使 ...