Admin/lib/scripts/churn_pie
author desharna
Wed, 29 Jun 2022 15:36:19 +0200
changeset 75637 66a9aa769d63
parent 64881 9eff4c62579a
permissions -rwxr-xr-x
added definition range_vars and lemmas vars_of_subst_conv_Union, vars_of_subst_subset, range_vars_comp_subset, and unify_gives_minimal_range

#!/usr/bin/python3 -Es

import re
import sys
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages

output = PdfPages('chart.pdf')

re_entry = re.compile(R'^(.*\S+)\s+(\d+)\s*\**\s*$')

labels = []
values = []

for line in sys.stdin.readlines():
    match = re_entry.match(line)
    labels.append(match.group(1))
    values.append(match.group(2))

plt.pie(values, labels = labels)
output.savefig()
output.close()