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 ...
随机推荐
- mesos是什么
听过不少人在讨论 Mesos,然而并不是很明白 Mesos 到底能够解决什么问题,使用场景是怎样的,周伟涛(国内较早一批接触使用 Docker,Mesos 等技术的开发者)用一句话形容它, Mesos ...
- 字节跳动的一道python面试题
#!/usr/bin/python #coding=utf-8 #好好学习,天天向上 lst = ['hongkong','xiantyk','chinat','guangdong','z'] lst ...
- 火爆的文字游戏你玩了吗?「GitHub 热点速览 v.22.06」
不知道你有没有被 Wordle 这款游戏刷屏,在本期热点速览的特推部分选了一个 React 编写的开源版本同你分享,而本次公众号摘要也是一个提示, 只不过这个只能盲猜了.别小瞧 Wordle 这个游戏 ...
- windows doc命令复制粘贴文件
# 删除前端文件 rmdir /s/q E:\yuanbo2019\public\static del E:\yuanbo2019\public\index.html @echo off ::被复制的 ...
- Apache中commons包的各种jar的功能说明
commons-logging.jar -----记录日志,通常和 log4j.jar共同使用 commons-beanutils.jar(1.1) 主要提供Bean的 ...
- 如何定制docker容器的系统时间
Dockerfile加入下面一句(标红的部分): FROM xxxxxxENV JAVA_OPTS="-Dfile.encoding=UTF-8"ENV TZ=Asia/Shang ...
- Centos 7 下部署Django + uWSGI + Nginx
1.废话 之前利用Django写了些测试工具,一直是直接 python manage.py runserver 8081这么来用的.用户量不大,倒也不影响什么.uWSGI+Nginx的性能肯定要好,s ...
- 一致性协议之ZAB
前言 一致性协议 包括 Paxos,Raft,2PC,3PC等等,今天我们讲一种协议,ZAB 协议,该协议应该是所有一致性协议中生产环境中应用最多的了.为什么呢?因为他是为 Zookeeper 设计的 ...
- byte溢出栗子
原创:转载需注明原创地址 https://www.cnblogs.com/fanerwei222/p/11634402.html byte溢出测试: byte b1 = (byte) 127; byt ...
- Python接口自动化测试_悠悠
https://yuedu.baidu.com/ebook/585ab168302b3169a45177232f60ddccda38e695###