Admin/lib/scripts/churn_pie
author wenzelm
Sat, 23 May 2015 17:19:37 +0200
changeset 60299 5ae2a2e74c93
parent 56427 5cbaf18d0dfb
child 64879 58525e7f721f
permissions -rwxr-xr-x
clarified NEWS: document_files are officially required since Isabelle2014, but the absence was tolerated as legacy feature;

#!/usr/bin/env python

import re
from pychart import theme, pie_plot, area, fill_style, arrow, legend
import sys

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

theme.get_options()

data = []

for line in sys.stdin.readlines():
    match = re_entry.match(line)
    data.append((match.group(1), int(match.group(2))))

plot = pie_plot.T(data = data, arc_offsets = [],
  shadow = (2, -2, fill_style.gray50), label_offset = 10, arrow_style = arrow.a3)

ar = area.T(size = (500, 500), legend = legend.T(), x_grid_style = None, y_grid_style = None)
ar.add_plot(plot)

ar.draw()