oldoc63 / learningDS

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

Two Histograms on a Plot #501

Open oldoc63 opened 1 year ago

oldoc63 commented 1 year ago

Now, we are going to look at the chart called histograms.png. This displays the breakdown of final exam scores between your first year of teaching vs your second year of teaching. The data you will need to recreate this chart is in the lists exam_scores1 and exam_scores2. Save your recreated chart to a file called my_histogram.png.

oldoc63 commented 1 year ago
  1. Create a fig of width 10 and height 8.
oldoc63 commented 1 year ago
  1. Make a histogram of the exam_scores1, normalized, with 12 bins.
  2. Make a histogram of the exam_scores2, normalized, with 12 bins.
oldoc63 commented 1 year ago
  1. Add histtype = 'step' to each plt.hist call, in order to make this histograms more visible. We can also make the lines thicker by setting the linewidth inside the calls to plt.hist. Let's set the linewidth to be 2 for both histograms.
oldoc63 commented 1 year ago
  1. Create a legend showing that the first set of data is "1st Yr Teaching" and the second set of data is "2nd Yr Teaching".
oldoc63 commented 1 year ago
  1. Add the title, x-axis label, and y-axis label that you see on the final graph.
oldoc63 commented 1 year ago
  1. Save your figure to a file called my_histogram.png.