the colour to be used for each category can be provided via the color parameter to the bar((and barh()function this is sequence of the colours to apply for examplethe above coloured bar chart can be generated usingpyplot bar(x_valuessizestick_label=labelscolor=('red''green''blue''yellow''orange')stacked bar charts bar charts can also be stacked this can be way of showing total values (and what contributes to those total valuesacross several categories that isit is way of viewing overall totalsfor several different categories based on how different elements contribute to those totals different colours are used for the different sub-groups that contribute to the overall bar 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 examplein the following chart the total usage of particular programming language is composed of its use in games and web development as well as data science analytics from this figure we can see how much each use of programming language contributes to the overall usage of that language the program that generated this chart is given below