matplotlib 中的 colors 和 cmaps
1、matplotlib中的 148 种颜色
import matplotlib as plm
import matplotlib.pyplot as plt colors = plm.colors.cnames.keys() fig = plt.figure('百里希文', facecolor='lightyellow', edgecolor='k')
axes = fig.subplots(len(colors)//4, 4) for c, ax in zip(colors, axes.ravel()):
ax.hist(1, 3, color=c)
ax.text(1.2, 0.1, c)
ax.set_axis_off()
fig.subplots_adjust(left=0, bottom=0, right=0.9,
top=1, hspace=0.1, wspace=0.1)
fig.show()

2 matplotlib 中的 160 种颜色映射
import numpy as npimport matplotlib as plm
import matplotlib.pyplot as plt cmaps = plm.cm.cmap_d.keys()
gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient)) fig = plt.figure('百里希文', facecolor='lightyellow', edgecolor='k')
axes = fig.subplots(len(cmaps)//5, 5) for cmap, ax in zip(cmaps, axes.ravel()):
ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(cmap))
ax.text(100, 1, cmap, fontsize=14)
ax.set_axis_off() fig.subplots_adjust(left=0.1, bottom=0, right=0.9,
top=1, hspace=0.1, wspace=0.1)
fig.show()

按语:
推荐几篇文章
https://cloud.tencent.com/developer/ask/136207/answer/241390
https://blog.csdn.net/Mr_Cat123/article/details/78638491
https://www.cnblogs.com/charliedaifu/p/9957822.html
https://blog.csdn.net/zhaogeng111/article/details/78419015
matplotlib 中的 colors 和 cmaps的更多相关文章
- 基于Python实现matplotlib中动态更新图片(交互式绘图)
最近在研究动态障碍物避障算法,在Python语言进行算法仿真时需要实时显示障碍物和运动物的当前位置和轨迹,利用Anaconda的Python打包集合,在Spyder中使用Python3.5语言和mat ...
- matplotlib中color可用的颜色
http://stackoverflow.com/questions/22408237/named-colors-in-matplotlib 参考网址给出了matplotlib中color可用的颜色: ...
- matplotlib中的颜色及线条控制
出自 http://www.cnblogs.com/darkknightzh/p/6117528.html 参考网址: http://stackoverflow.com/questions/22408 ...
- matplotlib中的legend()—显示图例
源自 matplotlib中的legend()——用于显示图例 -- 博客园 http://www.cnblogs.com/yinheyi/p/6792120.html legend()的一个用法: ...
- Matplotlib中中文不显示问题
我们在使用jupter进行数据分析的时候,会接触到Matplotlib这个库,它是用来进行可视化数据分析的,在一个图中,我们常常会加入一些中文来进行说明.当我们加入中文的时候会出现下图所示的样子: 可 ...
- python+NLTK 自然语言学习处理三:如何在nltk/matplotlib中的图片中显示中文
我们首先来加载我们自己的文本文件,并统计出排名前20的字符频率 if __name__=="__main__": corpus_root='/home/zhf/word' word ...
- Matplotlib中的颜色
使用matplotlib中会遇到选择颜色的问题,很多人会觉得自带的matlab风格的颜色不好看.好在Matplotlib已经预见到了这个问题,除了支持最基本的matlab传统颜色之外,还支持很多种颜色 ...
- 在values中添加colors.xml
如何在values中添加colors.xml文件?按钮上的文字,背景色的动态变化的xml放在res/drawable里,现在我就说静态的xml文件吧. res/values/colors.xml< ...
- 关于Matplotlib中No module named 'matplotlib.finance'的解决办法
最近在研究量化分析,需要用到matplotlib中的一个库,输入from matplotlib.finance import quotes_historical_yahoo_ohlc, candles ...
随机推荐
- [LeetCode] 13. Roman to Integer 罗马数字转化成整数
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 ...
- [LeetCode] 179. Largest Number 最大组合数
Given a list of non negative integers, arrange them such that they form the largest number. Example ...
- JOSH是中国的“MicroEJ”~
很多人不了解JOSH,我们推荐大家去看看MicroEJ,我们是中国版的MICROEJ,下面的文章翻译自MICROEJ的官网,让大家直观的了解~ MICROEJ被定位为可连接对象的ANDROID™的小兄 ...
- Gitlab安装、备份与恢复
背景:由于需要把gitlab从A服务器转移到B服务器,故在B服务器进行gitlab的安装和恢复备份 步骤: 一.在B服务器安装Gitlab 1. 获取安装包 wget https://mirrors. ...
- 关于 AutoResetEvent 的介绍的简单示例
关于 AutoResetEvent 的介绍的简单示例 直接贴代码了: class Program { static void Main(string[] args) { string result = ...
- python调用MySQL数据库
在Python中访问mysql数据库中的数据需要三步骤: 1,建立连接 2,操作数据库 3,连接关闭
- 深入V8引擎-AST(5)
懒得发首页了,有时候因为贴的代码太多会被下,而且这东西本来也只是对自己学习的记录,阅读体验极差,所以就本地自娱自乐的写着吧! 由于是解析字符串,所以在开始之前介绍一下词法结构体中关于管理字符串类的属性 ...
- Oracle的数据类型和表的操作
学习笔记: Oracle数据类型 1.创建表 ---创建一个person表 create table person( pid ), pname ) ); 2.修改表结构 --添加一列 )); --修改 ...
- 外网IP和内网IP区别
外网IP和内网IP区别? 网络结构 如图,假设我们的计算机现在就是设备一,我们想要访问百度.如果我们正使用着校园网,那么首先我们需要先通过校园网的路由器把我们的内网ip转为校园网的外网ip.然后通过这 ...
- sqlserver之datepart和datediff应用查找当天上午和下午的数据
DATEPART() 函数用于返回日期/时间的单独部分,比如年.月.日.小时.分钟等等. DATEDIFF() 函数返回两个日期之间的时间差. --查找当天上午的数据 ) --查找当天下午的数据 ) ...