API Reference

This is the class and function reference for accessiplot. Please refer to the full user guide for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.

accessiplot.detection: Inaccessibility Detection of Plots

The accessiplot.detection sub-module defines a set of tests of accessibility.

Contrast Ratio Detection

contrast_ratio.is_contrast_ratio_below_threshold(...)

Pass in a contrast ratio and it will detect if it is below a limit.

contrast_ratio.calculate_contrast_ratios_from_ax(dh)

Generates dictionaries of the contrast_ratios_by_index and detections.

contrast_ratio.calculate_contrast_ratio(...)

Calculates the contrast ratio given two tuples of normalized rgb values.

contrast_ratio.calculate_relative_luminance(rgb)

Calculates the relative luminance given a tuple of normalized rgb values.

contrast_ratio.normalize(primary_color)

Normalize the , G, or B value using the WCAG 2.0 formula defined for calculating the relative luminance.

Color Detection

color_detection.get_common_colors_from_image(...)

Given a file name of an image, return a list of most common colors used in the image, in RGB.

color_detection.get_common_colors_from_plot(plot)

Given a line chart, return a list of colors used for the lines and background, in RGB.

color_detection.convert_image(img[, ...])

Given an image, simulate how a person with color vision deficiency will see it.

color_detection.display_images(old, new)

Given an original version of an image and a tuple of its modified versions, display them in a single plot for readers to compare.

color_detection.compare_colors(colors[, ...])

Given a list of colors, check if any two of them are too similar to each other in the eye of someone with a specified color vision deficiency.

color_detection.full_detection(plt[, ...])

Given a line chart, detect if its use of color is unfriendly to people with either deuteranomaly, protanomaly or tritanomaly, and display the simulation for those color vision deficiencies.

Missing Label Detection

label.get_missing_labels_from_ax(dh)

Generates dictionaries of the contrast_ratios_by_index and detections.

Missing Marker Detection

marker.get_markers(plt)

Dummy function to prove out retrieving a list of markers given a Matplotlib pyplot object.

Overcomplexity Detection

visual_complexity.get_complexity(plt[, ...])

Given a line chart, calculate its visual complexity based on Pixel Approximate Entropy.

Detection Handler Classes

handler.DetectionHandler(ax[, histogram])

This is the entry point for generating detection outputs for a given axes object.

handler.DetectionTypes(value[, names, ...])

Enum used to keep track of supported detection tests.

accessiplot.utils: Utility Functions and Classes

Chart Type Enum

chart_type.ChartTypes(value[, names, ...])

Enum used to keep track of supported chart types

Chart Type Detection

chart_type.determine_chart_type(ax)

Determines the chart type based on the Axes object.