svmartin
2/4/2018 - 2:35 PM

average_sleep.py

import matplotlib.pyplot as plt
import numpy as np

height = [1, 1, 3, 4, 2, 2, 1]
average_sleep = [5, 5.5, 6, 6.5, 7, 8, 9]
y_pos = np.arange(len(average_sleep))

# create bars
plt.bar(y_pos, height)

# create names on the x-axis
plt.xticks(y_pos, average_sleep)
plt.ylabel('frequency')
plt.xlabel('time')
plt.show()