.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_accessibility.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_accessibility.py: 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. .. GENERATED FROM PYTHON SOURCE LINES 9-12 .. code-block:: Python import depictr as dp .. GENERATED FROM PYTHON SOURCE LINES 13-15 The safety report gives the worst-case minimum distance between any two palette colours, across normal vision and each deficiency at full severity. .. GENERATED FROM PYTHON SOURCE LINES 15-18 .. code-block:: Python report = dp.palette_safety() print(report) .. rst-class:: sphx-glr-script-out .. code-block:: none {'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} .. GENERATED FROM PYTHON SOURCE LINES 19-22 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. .. GENERATED FROM PYTHON SOURCE LINES 22-26 .. code-block:: Python ld = dp.lexical_decision() p = dp.explore_distribution(ld, "RT", group="condition", kind="both", legend_inside=True) p .. image-sg:: /auto_examples/images/sphx_glr_plot_accessibility_001.png :alt: plot accessibility :srcset: /auto_examples/images/sphx_glr_plot_accessibility_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.258 seconds) .. _sphx_glr_download_auto_examples_plot_accessibility.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_accessibility.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_accessibility.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_accessibility.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_