fixes due to code directory

This commit is contained in:
Roger Labbe
2014-09-01 19:34:01 -07:00
parent fc993eff4c
commit 81c1bddcff
5 changed files with 51 additions and 51 deletions

24
code/bar_plot.py Normal file
View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
"""
Created on Fri May 2 12:21:40 2014
@author: rlabbe
"""
import matplotlib.pyplot as plt
import numpy as np
def plot(pos, ylim=(0,1)):
plt.cla()
ax = plt.gca()
x = np.arange(len(pos))
ax.bar(x, pos)
if ylim:
plt.ylim([0,1])
plt.xticks(x+0.4, x)
plt.grid()
plt.show()
if __name__ == "__main__":
p = [0.2245871, 0.06288015, 0.06109133, 0.0581008, 0.09334062, 0.2245871,
0.06288015, 0.06109133, 0.0581008, 0.09334062]*2
plot(p)