series of lab exercises are displayed thus each team has bar for lab lab lab etc space is left between each category to make it easier to compare the sub categories the following program generates the grouped bar chart for the lab exercises exampleimport matplotlib pyplot as pyplot bar_width set up grouped bar charts teama_results ( teamb_results ( set up the index for each bar index_teama ( index_teamb [ bar_width for in index_teamadetermine the mid point for the ticks ticks [ bar_width for in index_teamatick_labels ('lab ''lab ''lab ''lab ''lab 'plot the bar charts pyplot bar(index_teamateama_resultsbar_widthcolor=' 'label='team 'pyplot bar(index_teambteamb_resultsbar_widthcolor=' 'label='team 'set up the graph pyplot xlabel('labs'pyplot ylabel('scores'pyplot title('scores by lab'pyplot xticks(tickstick_labelspyplot legend(display the graph pyplot show(notice in the above program that it has been necessary to calculate the index for the second team as we want the bars presented next to each other thus the index for the teams includes the width of the bar for each index pointthus the first bar is at index position the second at index position etc finally the tick positions must therefore be between the two bars and thus is calculated by taking into account the bar widths