Now, we are going to look at the chart called
side-by-side.png. This displays the differences in average test scores between students who went to two different middle schools before enrolling in your high school.
The data you will need to recreate this chart is in the lists
Save your recreated chart to a file called
create_x, make the lists
school_b_x which will determine where to put the bars for Middle School A and Middle School B along the x-axis.
Create a figure of width
10 and height
Create a set of axes and save them to
Plot a set of bars representing
middle_school_a and a set representing
middle_school_b next to each other on the same graph.
Create a new list of x-values called
middle_x, which are the values in the middle of
school_b_x. This is where we will place the x-ticks. Look at the final graph to see this placement.
Set the x-ticks to be the
Set the x-tick labels to be the list
Create a legend, as shown in the final graph, that labels the first set of bars
Middle School A and the second set of bars
Middle School B.
Create a title (“Test Averages on Different Units”), x-axis label (“Unit”), and y-axis label (“Test Average”).
Save your figure to a file called