dcav-stats/pieplot.py

18 lines
539 B
Python
Raw Normal View History

import matplotlib as mpl
mpl.use('svg')
import matplotlib.pyplot as plt
users = ['alexander','christoffermadsen','jmaa','jacob']
numbers = {}
for user in users:
number = open("log/" + user + ".log", "r").read().split("\n")[-2].split(" ")[1]
numbers[user] = number
values = list(numbers.values())
labels = list(numbers.keys())
fig1, ax1 = plt.subplots()
ax1.pie(values,labels=labels,autopct="%1.1f%%", shadow=True, startangle=90)
ax1.axis('equal')
plt.savefig("/home/christoffermadsen/public_html/img/dcavpie.svg", format="svg")