十六进制中的Altair默认调色板颜色 [英] Altair default color palette colors in HEX

查看:108
本文介绍了十六进制中的Altair默认调色板颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到Altair默认调色板的十六进制表示形式?每个绘图工具都有其优势和优势.弱点,我通常最终生成包含Seaborn + Altair的可视化图像.我想搭配Seaborn中的Altair颜色.对于Seaborn,您可以按以下方式获取color_palette的相关十六进制颜色表示,并且想知道如何在Altair中获得相似的颜色信息.

How can I find the HEX representation of Altair default color palette? Every plotting tool has its strengths & weaknesses and I typically end up generating visualizations consist of Seaborn + Altair. I would like to match Altair colors in Seaborn. For Seaborn, you can get the relevant HEX color representation of color_palette as follows and was wondering how can I get similar color information in Altair.

import seaborn as sns
sns.color_palette('Set2').as_hex()
    Out[131]: 
    ['#66c2a5',
     '#fc8d62',
     '#8da0cb',
     '#e78ac3',
     '#a6d854',
     '#ffd92f',
     '#e5c494',
     '#b3b3b3']

推荐答案

Altair使用的调色板在Vega-Lite渲染器中实现,如

The color palettes used by Altair are realized in the Vega-Lite renderer, as defined by the vega-scale package.

易读的摘要位于Vega的配色方案部分中文档.配色方案实际上是在 schemes.js 中定义的和 palettes.js .

A human-readable summary is in the Color Schemes section of the Vega documentation. The color schemes are actually defined in schemes.js and palettes.js.

不幸的是,调色板细节无法通过Altair从Python包本身获得.

Unfortunately, the color palette details are not available via Altair from the Python package itself.

这篇关于十六进制中的Altair默认调色板颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆