add pie plot using matplotlib for Python
This commit is contained in:
parent
beb2e8a428
commit
60907f1076
17
pieplot.py
Normal file
17
pieplot.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
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")
|
Loading…
Reference in New Issue
Block a user