Note
Go to the end to download the full example code
Visual Complexity Detection
This example shows how to detect over-complexity issue using the accessiplot.detection.visual_complexity module.
complexity score: (1.0853172794898325, {'Pixel Approximate Entropy': 1.0853172794898325, 'threshold': 0.5})
from accessiplot.detection.visual_complexity import get_complexity
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 6)
y = np.array([100, 10, 300, 20, 500])
num_lines = 5
for i in range(num_lines):
y_val = (np.random.rand(1, 5)).T
plt.plot(x, y_val)
complexity = get_complexity(plt)
print('complexity score: {}'.format(complexity))
Total running time of the script: ( 0 minutes 0.258 seconds)