matplotlib.colors(ListedColormap)
来源:互联网 发布:查端口8080是否被占用 编辑:程序博客网 时间:2024/05/29 17:33
hexadecimal colour code:
colour colour (Chinese) clour code RGB
matplotlib.colors.
ListedColormap
(colors, name='from_list', N=None)Colormap object generated from a list of colors.
This may be most useful when indexing directly into a colormap, but it can also be used to generate special colormaps for ordinary mapping.
Make a colormap from a list of colors.
- colors:
- a list of matplotlib color specifications, or an equivalent Nx3 or Nx4 floating point array (N rgb or rgba values)
- name:
- a string to identify the colormap
- N:
the number of entries in the map. The default is None, in which case there is one colormap entry for each element in the list of colors. If:
N < len(colors)
the list will be truncated at N. If:
N > len(colors)
the list will be extended by repetition.
- class
matplotlib.colors.
LinearSegmentedColormap
(name, segmentdata, N=256, gamma=1.0) Colormap objects based on lookup tables using linear segments.
The lookup table is generated using linear interpolation for each primary color, with the 0-1 domain divided into any number of segments.
Create color map from linear mapping segments
segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of x, y0, y1 tuples, forming rows in a table. Entries for alpha are optional.
Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use:
cdict = {'red': [(0.0, 0.0, 0.0), (0.5, 1.0, 1.0), (1.0, 1.0, 1.0)], 'green': [(0.0, 0.0, 0.0), (0.25, 0.0, 0.0), (0.75, 1.0, 1.0), (1.0, 1.0, 1.0)], 'blue': [(0.0, 0.0, 0.0), (0.5, 0.0, 0.0), (1.0, 1.0, 1.0)]}
Each row in the table for a given color is a sequence of x, y0, y1 tuples. In each sequence, x must increase monotonically from 0 to 1. For any input value z falling between x[i] and x[i+1], the output value of a given color will be linearly interpolated between y1[i] and y0[i+1]:
row i: x y0 y1 / /row i+1: x y0 y1
Hence y0 in the first row and y1 in the last row are never used.
Reference:
http://encycolorpedia.cn/77caca
http://matplotlib.org/api/_as_gen/matplotlib.colors.LinearSegmentedColormap.html#matplotlib.colors.LinearSegmentedColormap
- matplotlib.colors(ListedColormap)
- colors
- colors
- colors
- Colors
- MatPlotLib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- matplotlib
- Matplotlib
- 【BZOJ1053】【DFS】【打表】[HAOI2007]反素数ant 题解
- 使用JDBC连接数据库
- 数据类型和作用域链
- Hibernate 5.2.x 中 sessionFactory 的获取方式
- HBase安装配置
- matplotlib.colors(ListedColormap)
- Linux常用命令及软件更新
- JavaScript
- 枚举关于Flags特性的使用
- 小白之路—杨辉三角
- Dvwa漏洞测试之文件包含笔记
- cookie和sessiong
- 【BZOJ2761】【hash】[JLOI2011]不重复数字 题解
- 11.1模拟赛总结