CBSE Class 12 Informatics Practices Question 66 of 73

Data Visualization using Matplotlib — Question 4

Back to all questions
4
Question

Question 4

We can specify different colors for different bars of a bar chart.

Answer

True

Reason — In Matplotlib, we can specify different colors for different bars of a bar chart by passing a list of colors to the bar() function. The syntax is plt.bar(x, y, color=[color1, color2,.....]).