Now, we are going to look at the chart called
line_graph.png. This displays the relationship between the time students say they studied and the scores they received on their final exams.
The data you will need to recreate this chart is in the lists
Save your recreated chart to a file called
Create a figure of width
10 and height
exam_scores on the x-axis and the
hours_reported on the y-axis, with a
Let’s assume the error on students’ reporting of their hours studying is 20%.
Create a list
hours_lower_bound, which has the elements of
hours_reported minus 20%, and a list
hours_upper_bound, which has the elements of
hours_reported plus 20%.
You can do this with a list comprehension that looks like:
y_lower_bound = [element - (element * error_in_decimal) for element in original_list_of_y_values]
Shade the area between
hours_upper_bound with an alpha of
Give the plot the title
'Time spent studying vs final exam scores', x-axis label
'Score', and y-axis label
'Hours studying (self-reported)'.
Save your figure to a file called