-
Notifications
You must be signed in to change notification settings - Fork 4
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
57f3a35
commit 279b716
Showing
1 changed file
with
21 additions
and
22 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 |
---|---|---|
@@ -1,26 +1,25 @@ | ||
|
||
def calstat(): | ||
import matplotlib | ||
import utils | ||
|
||
matplotlib.use('Qt4Agg') | ||
from matplotlib import pyplot as plt | ||
vert = hori = 0 | ||
with open('movefile.txt', 'r') as in_file: | ||
for line in in_file: | ||
if line[0] == '1': | ||
vert += 1 | ||
else: | ||
hori += 1 | ||
import matplotlib | ||
import utils | ||
|
||
# Pie chart, where the slices will be ordered and plotted counter-clockwise: | ||
labels = 'Vertical Moves', 'Horizontal Moves' | ||
sizes = [vert, hori] | ||
explode = (0, 0.1) | ||
matplotlib.use('Qt4Agg') | ||
from matplotlib import pyplot as plt | ||
vert = hori = 0 | ||
with open('movefile.txt', 'r') as in_file: | ||
for line in in_file: | ||
if line[0] == '1': | ||
vert += 1 | ||
else: | ||
hori += 1 | ||
|
||
fig1, ax1 = plt.subplots() | ||
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%', | ||
shadow=True, startangle=90) | ||
ax1.axis('equal') # Equal aspect ratio ensures that pie chart is drawn as a circle. | ||
plt.show() | ||
# Pie chart, where the slices will be ordered and plotted counter-clockwise: | ||
labels = 'Vertical Moves', 'Horizontal Moves' | ||
sizes = [vert, hori] | ||
explode = (0, 0.1) | ||
|
||
fig1, ax1 = plt.subplots() | ||
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%', | ||
shadow=True, startangle=90) | ||
ax1.axis('equal') # Equal aspect ratio ensures that pie chart is drawn as a circle. | ||
plt.show() | ||
calstat() |