Accessibility: a validated colourblind-safe palette#

depictr defaults to the Okabe-Ito palette and checks that choice rather than asserting it: a Machado-2009 simulator and a CIE-Lab distance test confirm the colours stay distinguishable under each colour-vision deficiency.

import depictr as dp

The safety report gives the worst-case minimum distance between any two palette colours, across normal vision and each deficiency at full severity.

report = dp.palette_safety()
print(report)
{'min_delta_e': 7.4, 'by_condition': {'normal': 33.43, 'protan': 18.15, 'deutan': 7.4, 'tritan': 16.18}, 'worst_condition': 'deutan', 'worst_pair': ('#cc79a7', '#999999'), 'safe': True, 'threshold': 5.0}

A grouped distribution in the default palette – histogram with its density curve. legend_inside tucks the legend into the empty top-right corner instead of a separate margin.

ld = dp.lexical_decision()
p = dp.explore_distribution(ld, "RT", group="condition", kind="both",
                            legend_inside=True)
p
plot accessibility

Total running time of the script: (0 minutes 1.258 seconds)

Gallery generated by Sphinx-Gallery