-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotPiechart.py
92 lines (76 loc) · 3.41 KB
/
plotPiechart.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 10:35:44 2015
plot pie chart
@author: zimu
"""
import matplotlib.pyplot as plt
chart = 4
if chart == 0:
# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral']
explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True, startangle=90)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.show()
elif chart == 1:
# The slices will be ordered and plotted counter-clockwise.
labels = 'Covered Results', 'Uncovered Results'
sizes = [90.476, 9.524]
colors = ['yellowgreen','orange']
explode = (0.1, 0) # only "explode" the 1st slice
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.2f%%', shadow=True, startangle=-90)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.rcParams['axes.labelsize'] = 50
plt.rcParams['font.size'] = 50
#print plt.rcParams.keys() #if you do not know what parameters will work
plt.show()
elif chart == 2:
# The slices will be ordered and plotted counter-clockwise.
labels = 'Covered Results', 'Uncovered Results'
sizes = [57.143, 42.857]
colors = ['yellowgreen','orange']
explode = (0.1, 0) # only "explode" the 1st slice
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.2f%%', shadow=True, startangle=-10)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.rcParams['axes.labelsize'] = 50
plt.rcParams['font.size'] = 50
#print plt.rcParams.keys() #if you do not know what parameters will work
plt.show()
elif chart == 3:#Probabilities - the exact number of group that a zone is contained in (totally 8 groups).
# The slices will be ordered and plotted counter-clockwise.
labels = 'Only 1 group', '2 groups', '3 groups', '4 groups', '5 groups'
sizes = [15.625,31.25,31.25,15.625,6.25]
colors = ['grey','yellowgreen','orange','yellow','pink']
explode = (0.3, 0,0,0,0) # only "explode" the 1st slice
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.2f%%', shadow=True, startangle=-80)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
#plt.title('The exact number of group that layers are contained in')
plt.rcParams['axes.labelsize'] = 50
plt.rcParams['font.size'] = 50
#print plt.rcParams.keys() #if you do not know what parameters will work
plt.show()
elif chart == 4:
# The slices will be ordered and plotted counter-clockwise.
labels = 'Not overlap', 'Overlap'
sizes = [15.625, 84.375]
colors = ['grey','orange']
explode = (0.3, 0) # only "explode" the 1st slice
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.2f%%', shadow=True, startangle=-80)
# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.rcParams['axes.labelsize'] = 50
plt.rcParams['font.size'] = 50
#print plt.rcParams.keys() #if you do not know what parameters will work
plt.show()