Data colouring for Matplotlib plots
Martin McBride, 2022-06-23
Tags bar style marker style
Categories matplotlib

Matplotlib allows us to choose colours and styles for our data plots. It also allows us to vary the colour of style for each data point depoending on the data itself. For example:
- In a bar chart, we can colour each bar according to the data. For example, bars where the value is less than a particular limit could be coloured green, bars where the greater than the limit could be coloured red.
- In a scatter chart, we can change the colour, shape or size of the marker based on the data. This can even depend on different elements of the data, which gives the graph an extra dimension.
We will look at examples of these techniques in this section.
If you found this article useful, you might be interested in the course Introduction to Matplotlib by the same author.
Prev