简化matplotlib颜色映射和颜色编解码器操作的实用程序(例如hex2rgb)

colormap的Python项目详细描述


有关最新文档,请参见:http://colormap.readthedocs.io/

https://badge.fury.io/py/colormap.svghttps://secure.travis-ci.org/cokelaer/colormap.pnghttps://coveralls.io/repos/cokelaer/colormap/badge.png?branch=masterhttps://landscape.io/github/cokelaer/colormap/master/landscape.png
version:Python 2.7, 3.3, 3.4, 3.5, 3.6
contributions:Please join https://github.com/cokelaer/colormap
issues:Please use https://github.com/cokelaer/colormap/issues
notebook:Please see https://github.com/cokelaer/colormap/tree/master/notebooks

这是什么?

colormap包提供了在 rgb、hex、hls、huv和一个类,可以轻松地为matplotlib构建颜色映射。全部 matplotlib colormaps和一些r colormaps一起提供。这个 plot_colormap方法(见下文)可以方便地快速获取一个colormaps和 test_colormap对于查看test a new colormap很有用。

安装

pip install colormap

示例

  • 创建自己的颜色映射,从红色到绿色,中间色为 白色(地图从红色变为绿色):

    c = Colormap()
    mycmap = c.cmap( {'red':[1,1,0], 'green':[0,1,.39], 'blue':[0,1,0]})
    cmap = c.test_colormap(mycmap)
    
  • 如果颜色映射是线性的,则更简单:

    c = Colormap()
    mycmap = c.cmap_linear('red', 'white', 'green(w3c)')
    cmap = c.test_colormap(mycmap)
    
http://colormap.readthedocs.io/en/latest/_images/index-1.png
  • 查看可用的彩色地图:

    c = Colormap()
    c.plot_colormap('diverging')
    
http://colormap.readthedocs.io/en/latest/_images/colormaps.png

有关详细信息,请参阅联机文档:http://colormap.readthedocs.io/

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android将字符串拆分为数组   java如何读取底层HttpServerExchange对象中的响应数据?   在jenkins上安装gitplugin时出现java错误   java DecimalFormat格式decimal,用于保留可变数量的尾随零   java Jaxws、spring和SpringBeanAutowiringSupport   Gson中抽象类的java反序列化   监视Windows服务器中的UDP数据包丢失,Java   java从侦听器调用所有者类   java Scala和Robocode类循环错误   java映像未上载到数据库   java如何将XML文件直接写入zip存档?   java为什么需要EventSourcingHandler(在聚合对象中)?   接受特定对象或其子类型的java通用方法   java Spring安全过滤器映射在特定Url模式上禁用