且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从颜色名称matplotlib获取十六进制

更新时间:2023-01-27 12:14:28

matplotlib.colors.cnames 是所有字典matplotlib的颜色及其十六进制值:

matplotlib.colors.cnames is a dictionary of all of matplotlib's colors and their hex values:

import matplotlib
print matplotlib.colors.cnames["blue"]
  --> u'#0000FF'