A powerful way of displaying different categories is to present them as stacked bars, so each of the categories and the total are displayed. We'll see in this recipe how to do that.
Drawing stacked bars
Getting ready
We need to install matplotlib in our virtual environment:
$ echo "matplotlib==2.2.2" >> requirements.txt
$ pip install -r requirements.txt
If you are using macOS, it's possible that you get an error like this: RuntimeError: Python is not installed as a framework. See the matplolib documentation on how to fix it: https://matplotlib.org/faq/osx_framework.html.