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 ...
随机推荐
- 【php】day01
一.PHPCORE基础 1.什么是PHP:[Hypertext Preprocessor] WEB程序开发语言,运行在服务器端 的 ...
- [NOIP2015]运输计划 线段树or差分二分
目录 [NOIP2015]运输计划 链接 思路1 暴力数据结构 思路2 二分树上差分 总的 代码1 代码2 [NOIP2015]运输计划 链接 luogu 好久没写博客了,水一篇波. 思路1 暴力数据 ...
- java ++前缀
public class Sample { public static void main(String[] args) { , num2 = ; , num4 = ; ++num1; System. ...
- 什么是默认登录shell,如何改变指定用户的登录shell?
在Linux操作系统,“/bin/bash”是默认登录shell,是在创建用户时分配的.使用chsh命令可以改变默认的shell.示例如下所示: #chsh <username> -s & ...
- Oracle 的 连接
select a.alert_id, b.alert_id from a inner join b on a.alert_id = b.alert_id ; 上面和下面是一样的,都是 内连接 sele ...
- iptables如何安全的清空规则
使用 /sbin/iptables -F 要小心,搞不好,你就马上同服务器断开连接了 如果想清空的话,先执行 /sbin/iptables -P INPUT ACCEPT 然后执行 /sbin/ipt ...
- c# mongodb时间类型字段保存时相差八个小时解决办法
/// <summary> /// 添加时间 /// </summary> [BsonDateTimeOptions(Kind = DateTimeKind.Local)] p ...
- linux开启tcp_timestamps和tcp_tw_recycle引发的问题研究
环境:centos7.4 内核版本3.10 最近看内核参数tcp_tw_recycle(该参数在内核 4.12 之后被移除),它用于快速回收处理TIME_WAIT状态的socket.搜索该参数相关的资 ...
- Sitecore个性化 - 基础知识
许多组织选择Sitecore作为其高级个性化功能的网站平台.Sitecore个性化需要什么以及它能为您的品牌提供什么? 今天, 对于希望提供更好的客户体验的组织来说,个性化不仅仅是一个很好的选择 - ...
- eclipse卡在revert resources的解决方法
遇到Eclipse卡在Revert Resources进程的问题,等又等不到它执行完毕(进度一直是0%),取消又是石沉大海一样毫无动静.更气人的是这个进程阻塞了其他所有的进程,什么操作都做不了.真是苦 ...