当前位置: 首页 > news >正文

基木鱼建站教程河南电商网站设计

基木鱼建站教程,河南电商网站设计,建立主题网站的知识点,宁波外贸seo网站建设详解matplotlib的color配置 Matplotlib可识别的color格式 格式举例RGB或RGBA,由[0, 1]之间的浮点数组成的元组,分别代表红色、绿色、蓝色和透明度(0.1, 0.2, 0.5), (0.1, 0.2, 0.5, 0.3不区分大小写的十六进制RGB或RGBA字符串。‘#0f0f0f’, ‘#0f0f0f…

详解matplotlib的color配置

Matplotlib可识别的color格式

格式举例
RGB或RGBA,由[0, 1]之间的浮点数组成的元组,分别代表红色、绿色、蓝色和透明度(0.1, 0.2, 0.5), (0.1, 0.2, 0.5, 0.3
不区分大小写的十六进制RGB或RGBA字符串。‘#0f0f0f’, ‘#0f0f0f80’
不区分大小写的RGB或RGBA字符串等效的十六进制缩写重复字符。‘#abc’ 等于 ‘#aabbcc’
对于灰度值,浮点值在闭合区间[0,1]中的字符串表示形式。‘0’ 表示黑色,‘1’表示白色,‘0.8’表示浅灰色
一些基本颜色的单字符简写符号。‘b’表示蓝色
不区分大小写的X11/CSS4颜色名称,不包含空格。‘aquamarine’
使用前缀’xkcd:'进行xkcd颜色调查,颜色名称不区分大小写。‘xkcd:sky blue’
来自T10分类调色板的不区分大小写的Tableau颜色。‘tab:blue’
CN"颜色规范,其中C排在一个数字前面,作为默认属性cycle的索引‘C0’
import matplotlib.pyplot as plt
import numpy as npt = np.linspace(0.0, 2.0, 201)
s = np.sin(2 * np.pi * t)# 1) RGB tuple:
fig, ax = plt.subplots(facecolor=(.18, .31, .31))
# 2) hex string:
ax.set_facecolor('#eafff5')
# 3) gray level string:
ax.set_title('Voltage vs. time chart', color='0.7')
# 4) single letter color string
ax.set_xlabel('Time [s]', color='c')
# 5) a named color:
ax.set_ylabel('Voltage [mV]', color='peachpuff')
# 6) a named xkcd color:
ax.plot(t, s, 'xkcd:crimson')
# 7) Cn notation:
ax.plot(t, .7*s, color='C4', linestyle='--')
# 8) tab notation:
ax.tick_params(labelcolor='tab:orange')plt.show()

通过辅助函数认识颜色

import mathfrom matplotlib.patches import Rectangle
import matplotlib.pyplot as plt
import matplotlib.colors as mcolorsdef plot_colortable(colors, *, ncols=4, sort_colors=True):cell_width = 212cell_height = 22swatch_width = 48margin = 12# Sort colors by hue, saturation, value and name.if sort_colors is True:names = sorted(colors, key=lambda c: tuple(mcolors.rgb_to_hsv(mcolors.to_rgb(c))))else:names = list(colors)n = len(names)nrows = math.ceil(n / ncols)width = cell_width * 4 + 2 * marginheight = cell_height * nrows + 2 * margindpi = 72fig, ax = plt.subplots(figsize=(width / dpi, height / dpi), dpi=dpi)fig.subplots_adjust(margin/width, margin/height,(width-margin)/width, (height-margin)/height)ax.set_xlim(0, cell_width * 4)ax.set_ylim(cell_height * (nrows-0.5), -cell_height/2.)ax.yaxis.set_visible(False)ax.xaxis.set_visible(False)ax.set_axis_off()for i, name in enumerate(names):row = i % nrowscol = i // nrowsy = row * cell_heightswatch_start_x = cell_width * coltext_pos_x = cell_width * col + swatch_width + 7ax.text(text_pos_x, y, name, fontsize=14,horizontalalignment='left',verticalalignment='center')ax.add_patch(Rectangle(xy=(swatch_start_x, y-9), width=swatch_width,height=18, facecolor=colors[name], edgecolor='0.7'))return fig
  • 基本色
plot_colortable(mcolors.BASE_COLORS, ncols=3, sort_colors=False)

在这里插入图片描述

  • 表盘色
plot_colortable(mcolors.TABLEAU_COLORS, ncols=2, sort_colors=False)

在这里插入图片描述

  • CSS颜色
plot_colortable(mcolors.CSS4_COLORS)
plt.show()

在这里插入图片描述

  • XKCD颜色
xkcd_fig = plot_colortable(mcolors.XKCD_COLORS)
xkcd_fig.savefig("XKCD_Colors.png")

在这里插入图片描述

matplotlib.colors API 点击进入

http://www.yayakq.cn/news/247739/

相关文章:

  • 网站做电源百度公司地址
  • 微网站建设步骤橙色企业网站
  • 哪里有.net电子商务网站开发教程电商网站规划与设计论文
  • 企业网站推广的模式湖南建设厅特种工查询
  • 网站添加文章之后更新缓存访问网站就需要输入账号密码谷歌推广seo
  • 网站导航栏制作做彩票网站代理犯法吗
  • 建网站去哪里备案自己做网站犯法吗
  • 做网站卖房写标题广元网页制作公司
  • 广州营销策划公司排名wordpress 文章seo
  • 外贸网站怎么做优化网站模板案例
  • 郑州惠济区建设局网站wordpress文章站主题
  • 怎么做网站的产品分析天津做网站多少钱
  • 招聘网站竞品分析怎么做个人备案网站做什么
  • 南昌seo网站管理注册网络公司需要什么条件
  • 手机网站模板制作firework做网站教程
  • 网站建设 考核指标企业画册设计模板
  • 网站建设书模板网站开发服务费记账
  • 专门做蛋糕面包的网站阿里云wordpress帮助
  • 网站上面的logo怎么做深圳哪里有网站建设
  • 大庆企业网站建设公司如何使用wordpress
  • 东莞建设教育网站第一源码交易平台
  • 内蒙古建设工程社保中心网站泉州做网站价格
  • 哪里找做网站的做t恤的网站
  • 网站二次开发费用兰州网站建设ulezhi
  • vps服务器购买网站衡水网站建设电话
  • 网站开发报告样式百度网站如何优化排名
  • 建设厅厦门网站优化服务
  • 人才网站开发方案舆情app免费
  • asp网站开发pdf宁波市建设银行网站
  • wordpress设置2个网站吗方案模板