General Detection of all Inaccessibilities

This example shows how to detect all inaccessiblities and write the output as a JSON.

example detect all inaccessibilities
CONTRAST_RATIO : {'_child0_---__child1': 1.9040396041710697, '_child0_---__child2': 1.4168312890382477, '_child0_---__child3': 1.0420980213864404, '_child0_---__child4': 1.1327015819803465, '_child0_---__child5': 1.227815191839397, '_child0_---__child6': 1.7639648250875561, '_child0_---__child7': 1.2039843979694074, '_child0_---__child8': 2.3967613887668797, '_child0_---__child9': 2.135607876861989, '_child1_---__child0': 1.9040396041710697, '_child1_---__child2': 1.3438717925713946, '_child1_---__child3': 1.9841959041480925, '_child1_---__child4': 1.6809719651332722, '_child1_---__child5': 2.337808751865111, '_child1_---__child6': 1.0794090545861994, '_child1_---__child7': 1.5814487358659695, '_child1_---__child8': 1.2587770671977794, '_child1_---__child9': 1.1216194622126747, '_child2_---__child0': 1.4168312890382477, '_child2_---__child1': 1.3438717925713946, '_child2_---__child3': 1.4764770829451577, '_child2_---__child4': 1.2508425092522129, '_child2_---__child5': 1.7396069809545562, '_child2_---__child6': 1.2450069664151364, '_child2_---__child7': 1.1767854229903805, '_child2_---__child8': 1.6916349937428425, '_child2_---__child9': 1.5073127572667107, '_child3_---__child0': 1.0420980213864404, '_child3_---__child1': 1.9841959041480925, '_child3_---__child2': 1.4764770829451577, '_child3_---__child4': 1.18038607740301, '_child3_---__child5': 1.1782146848392174, '_child3_---__child6': 1.8382242540190206, '_child3_---__child7': 1.254669758904064, '_child3_---__child8': 2.497660300969382, '_child3_---__child9': 2.2255127429351753, '_child4_---__child0': 1.1327015819803465, '_child4_---__child1': 1.6809719651332722, '_child4_---__child2': 1.2508425092522129, '_child4_---__child3': 1.18038607740301, '_child4_---__child5': 1.3907482101759876, '_child4_---__child6': 1.5573076379071946, '_child4_---__child7': 1.0629316822039165, '_child4_---__child8': 2.1159689603121485, '_child4_---__child9': 1.8854108715273639, '_child5_---__child0': 1.227815191839397, '_child5_---__child1': 2.337808751865111, '_child5_---__child2': 1.7396069809545562, '_child5_---__child3': 1.1782146848392174, '_child5_---__child4': 1.3907482101759876, '_child5_---__child6': 2.165822810112826, '_child5_---__child7': 1.4782703345644488, '_child6_---__child0': 1.7639648250875561, '_child6_---__child1': 1.0794090545861994, '_child6_---__child2': 1.2450069664151364, '_child6_---__child3': 1.8382242540190206, '_child6_---__child4': 1.5573076379071946, '_child6_---__child5': 2.165822810112826, '_child6_---__child7': 1.4651060495988069, '_child6_---__child8': 1.3587353640387438, '_child6_---__child9': 1.2106862033124646, '_child7_---__child0': 1.2039843979694074, '_child7_---__child1': 1.5814487358659695, '_child7_---__child2': 1.1767854229903805, '_child7_---__child3': 1.254669758904064, '_child7_---__child4': 1.0629316822039165, '_child7_---__child5': 1.4782703345644488, '_child7_---__child6': 1.4651060495988069, '_child7_---__child8': 1.9906914016570008, '_child7_---__child9': 1.773783680638903, '_child8_---__child0': 2.3967613887668797, '_child8_---__child1': 1.2587770671977794, '_child8_---__child2': 1.6916349937428425, '_child8_---__child3': 2.497660300969382, '_child8_---__child4': 2.1159689603121485, '_child8_---__child6': 1.3587353640387438, '_child8_---__child7': 1.9906914016570008, '_child8_---__child9': 1.1222853290317618, '_child8_---_BACKGROUND': 2.011415206436284, '_child9_---__child0': 2.135607876861989, '_child9_---__child1': 1.1216194622126747, '_child9_---__child2': 1.5073127572667107, '_child9_---__child3': 2.2255127429351753, '_child9_---__child4': 1.8854108715273639, '_child9_---__child6': 1.2106862033124646, '_child9_---__child7': 1.773783680638903, '_child9_---__child8': 1.1222853290317618, '_child9_---_BACKGROUND': 2.2573817767748343, 'BACKGROUND_---__child8': 2.011415206436284, 'BACKGROUND_---__child9': 2.2573817767748343}
LABEL : {'lines': {0: '_child0', 1: '_child1', 2: '_child2', 3: '_child3', 4: '_child4', 5: '_child5', 6: '_child6', 7: '_child7', 8: '_child8', 9: '_child9'}, 'axes': {'x': '', 'y': ''}, 'title': '', 'legend': None}
COLOR : {'deuteranomaly': True, 'protanomaly': True, 'tritanomaly': {}}
OVERCOMPLEXITY : {'Pixel Approximate Entropy': 8.501371602068966, 'threshold': 0.5}

from accessiplot.detection.handler import DetectionHandler, DetectionTypes
import matplotlib.pyplot as plt
import numpy as np


# data to be plotted
x = np.arange(1, 11)
_ = np.array([100, 10, 300, 20, 500, 60, 700, 80, 900, 100])
num_lines = 10

# Reset the figure so that tests start with a fresh figure.
_ = plt.figure()
ax = plt.axes()
for _ in range(num_lines):
    y_val = (np.random.rand(1, 10)).T
    ax.plot(x, y_val)

dh = DetectionHandler(ax=ax)
dh.run_detections(run_detections_list=DetectionTypes.ALL())

for key in dh.detections.keys():
    print(key, ":", dh.detections[key])

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

Gallery generated by Sphinx-Gallery