Getting ready

To use pyplot, we will need to install matplotlib.

Because of a problem with the matplotlib installer, performing the installation using pip-3.2 doesn't always work correctly. The method that follows will overcome this problem by performing all the steps pip does manually; however, this can take over 30 minutes to complete. To save time, you can try the pip installation, which is much quicker. If it doesn't work, you can install it using the aforementioned manual method. Use the following commands to try to install matplotlib using pip:   sudo apt-get install tk-dev python3-tk libpng-dev   sudo pip-3.2 install numpy   sudo pip-3.2 install matplotlib

You can confirm that matplotlib has been installed by running python3 and ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.