First, we are going to look at the chart called bar_chart.png
.
The data you will need to recreate this chart is in the lists past_years_averages
, years
, and error
.
Save your recreated chart to a file called my_bar_chart.png
.
Instructions
First, create a figure of width 10
and height 8
.
Plot the blue bars, which have the heights listed in past_years_averages
.
Add error bars of cap size 5
and heights corresponding to the list error
.
Set the axis to go from -0.5
to 6.5
on the x-axis and 70
to 95
on the y-axis.
Create an ax
object using plt.subplot()
. Use ax
to set the x-axis ticks to be range(len(years))
and the x-axis labels to be the years
list.
Add the title "Final Exam Averages"
, x-axis label "Year"
, and y-axis label "Test average"
.
Save your figure to a file called my_bar_chart.png
.