plot_bar 2¶

Query¶

import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

"""
Create matrix of ones
"""
a = np.ones((5,10))
# end

"""
make a bar chart from hours_worked
label x axis with days of the week
add an x and y label
save to bar.png
"""
hours_worked = [0,5,8,7,8.5,9,6]

Output¶

import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

"""
Create matrix of ones
"""
a = np.ones((5,10))
# end

"""
make a bar chart from hours_worked
label x axis with days of the week
add an x and y label
save to bar.png
"""
hours_worked = [0,5,8,7,8.5,9,6]
days = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']
plt.bar(days,hours_worked)
plt.xlabel('Days')
plt.ylabel('Hours')
plt.savefig('bar.png')

Evaluate¶

Go to Google Form