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