Ever needed a few more colours than the standard colour cycle for your plot? Ever wanted a categorical colour palette based around your own custom colours? With glasbey you can create and extend custom categorical colour palettes with ease.🧵
The glasbey library is on github: github.com/lmcinnes/glasb…
Documentation can be found on readthedocs: glasbey.readthedocs.org
And you can pip install it:
$ pip install glasbey
Create a categorical colour palette with control over the hue, chroma and lightness of colours to include in the palette. Do you need a muted palette? A Pastel palette? Or a palette of only cool colours?
Have a palette you like, but need a few extra distinct colours for your plot? Extend existing categorical colour palettes! Want a few extra colours for the default matplotlib palette? Or ColorBrewer Set1? Or a longer Pastel palette?
Want to build a categorical colour palette around your company/institution colours? You can seed palette creation and still control the hue, chroma and lightness of the palette you create.
Do you have hierarchical groups of categories, and you need a categorical colour palette that can show that? You can create block palettes, with varying sized blocks so each group of categories can be distinguished.
Glasbey uses techniques from the paper “Colour Displays for Categorical Images” by Glasbey et al to create colour palettes that maximize the visual distinctiveness of the colours. This library was based on the great work of Sergey Alexandrov (github.com/taketwo/glasbey).
By optimizing with @numba_jit and cutting a few corners glasbey can generate colour palettes fast enough for interactive use, making it easy to generate palettes on the fly, or experiment with parameters to get the palette you want.
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
