Admin/lib/scripts/churn_pie
author haftmann
Fri, 23 Apr 2021 09:50:14 +0000
changeset 73594 5c4a09c4bc9c
parent 64881 9eff4c62579a
permissions -rwxr-xr-x
collecting more lemmas concerning multisets

#!/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()