-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e8cf90
commit 1466fed
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Wed Sep 16 10:35:44 2015 | ||
plot pie chart | ||
@author: zimu | ||
""" | ||
|
||
import matplotlib.pyplot as plt | ||
|
||
chart = 2 | ||
|
||
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() |