graphing with matplotlib pyplot import matplotlib pyplot as pyplot set up the data labels ('python''scala'' #''java''php'index ( web_usage [ data_science_usage [ games_usage [ set up the bar chart pyplot bar(indexweb_usagetick_label=labelslabel='web'pyplot bar(indexdata_science_usagetick_label=labelslabel='data science'bottom=web_usageweb_and_games_usage [web_usage[idata_science_usage[ifor in range( len(web_usage))pyplot bar(indexgames_usagetick_label=labelslabel='games'bottom=web_and_games_usageconfigure the layout pyplot ylabel('usage'pyplot xlabel('programming languages'pyplot legend(display the chart pyplot show(one thing to note from this example is that after the first set of values are added using the pyplot bar(functionit is necessary to specify the bottom locations for the next set of bars using the bottom parameter we can do this just using the values already used for web_usage for the second bar charthowever for the third bar chart we must add the values used for web_usage and data_science_usage together (in this case using for list comprehensiongrouped bar charts finallygrouped bar charts are way of showing information about different sub-groups of the main categories in such casesa legend or key is usually provided to indicate what sub-group each of the shadings/colours represent the legend can be placed in the plot area or may be located below the chart for particular category separate bar charts are drawn for each of the subgroups for examplein the following chart the results obtained for two sets of teams across