I have created the following chart:
using the following code:
def plot_exercises_scores(exercise_list, scores, semester_id):
print (exercise_list)
plt.bar(exercise_list, scores, color='orange')
plt.title("Exercise scores for " + semester_id, fontsize=20)
plt.xlabel("exercise number", fontsize=16 )
plt.ylabel("score", fontsize=16)
plt.ylim(0, 100)
plt.show()
Look at the x-axis - it shows the bar on values 0.75, 1.25, 1.75, 2.25 while they don't even exists in exercise_list
.
exercise_list = [1 2]
Any idea what I'm missing?