Log in from a computer to take this course

You'll need to log in from a computer to start Learn Data Visualization with Python. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store

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.



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.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?