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 ...
随机推荐
- 跑批 - Spring Batch 批处理使用记录
根据spring官网文档提供的spring batch的demo进行小的测验 启动类与原springboot启动类无异 package com.example.batchprocessing; imp ...
- 4-ESP8266 SDK开发基础入门篇--串口
所有的源码 https://gitee.com/yang456/Learn8266SDKDevelop.git 手头有任何8266的板子就可以,不需要购买 https://item.taobao.co ...
- 把 DataTable 输出到 excel 文件
''' <summary> ''' 把 DataTable 输出到 excel 文件 ''' </summary> ''' <param name="dt_da ...
- C/C++深度优先搜索(递归树模拟)
//C++深度优先搜索(递归树模拟) #define _CRT_SECURE_NO_WARNINGS #include <iostream> #define MAX_N 1000 usin ...
- 【MySQL】Mariadb安装
Mariadb安装 1.解压 [root@oradb bin]# tar zxvf mariadb-10.3.18-linux-x86_64.tar.gz [root@oradb bin]# mv m ...
- Linux操作USB手柄
Linux控制原理 Linux C控制JoyStick的比较简单,首先在JoyStick在Linux 安装好驱动后会在/dev/input生成js0.对其设备控制,就是读取相应的结构来判断用户输入哪一 ...
- vue条件语句、循环语句、计算属性、侦听器监听属性
因为 v-if 和v-for是一个指令,所以必须将它添加到一个元素上.但是如果想切换多个元素呢?此时可以把一个 <template> 元素当做不可见的包裹元素,并在上面使用 v-if.最终 ...
- 四、Hexo静态博客绑定域名及域名解析
示例: http://zsy.xyz/ 域名准备 购买域名及实名认证不再赘述,可通过阿里云.腾讯云等平台自行购买域名. 域名解析 进入解析界面 添加记录 选择主机记录,根据提示自行选择 记录类型选 ...
- C# LDAP认证登录类参考
public class LDAPHelper { private DirectoryEntry _objDirectoryEntry; /// <sum ...
- WPF MainWindow的TopMost,Resizemode
Topmost -[true,false] The default is false, but if set to true, your Window will stay on top of othe ...