Docsity

Installing matplotlib in Thonny, Study Guides, Projects, Research of Advanced Computer Programming

Partial preview of the text

Download Installing matplotlib in Thonny and more Study Guides, Projects, Research Advanced Computer Programming in PDF only on Docsity!

Installing matplotlib in Thonny

Please note the process may be slightly different on Macs.

  1. Open Thonny:
  2. To confirm that matplotlib is not already installed, you should get an error when you type the following into the shell: import matplotlib
  1. Now we need to install matplotlib! Select “Tools → Manage packages…”
  2. You may need to wait a bit for the package manager to load. Next, enter “matplotlib” in the box and click “Search”
  1. Once that finishes, matplotlib should now be installed! Click “Close”
  2. To confirm the installation, try importing matplotlib again. You should get no errors this time.
  3. To get a basic example of how matplotlib works, create a new .py file with the following text: import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show()
  4. Running this should give you a simple graph