Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Altair default color palette colors in HEX

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']
like image 218
oekici Avatar asked Dec 13 '22 13:12

oekici


1 Answers

It seems like the default color palette of Altair (from the Vega-Lite renderer) is quite similar to Category 10:

#1f77b4, #ff7f0e, #2ca02c, #d62728, #9467bd,
#8c564b, #e377c2, #7f7f7f, #bcbd22, #17becf

The details of different palettes can be found here: https://d3-wiki.readthedocs.io/zh_CN/master/Ordinal-Scales/

enter image description here

like image 60
oekici Avatar answered Dec 22 '22 15:12

oekici