oldoc63 / learningDS

Learning DS with Codecademy and Books
0 stars 0 forks source link

Line with Shaded Error #503

Open oldoc63 opened 1 year ago

oldoc63 commented 1 year ago

Now, we are going to look at the chart called line_graph.png. This display 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 hours_reported and exam_scores.

  1. Create a figure of width 10 and height 8.
oldoc63 commented 1 year ago
  1. Plot the exam_scores on the x-axis and the hours_reported on the y-axis, with a linewidth of 2.
oldoc63 commented 1 year ago
  1. 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%.
oldoc63 commented 1 year ago
  1. Shade the area between hours_lower_bound and hours_upper_bound with an alpha of 0.2.
oldoc63 commented 1 year ago
  1. Give the plot the title 'Time spent studying vs final exam scores', x-axis label 'Score', and y-axis label 'Hours studying (self-reported)'.
oldoc63 commented 1 year ago
  1. Save your figure to a file called my_line_graph.png.