Admin/lib/scripts/churn_pie
author wenzelm
Mon, 22 May 2017 00:23:25 +0200
changeset 65897 94b0da1b242e
parent 64881 9eff4c62579a
permissions -rwxr-xr-x
back to scala-2.11.8 due to apparent non-termination of HOL-Codegenerator_Test;

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