Matplotlib installation can see the official website link http://matplotlib.org/users/installing.html
The following is a summary of the steps:
Download the. exe file on Windows.
1. Download and install python.
2. Install matplotlib of the required version (based on the Python version in step 1 ,.
The following is the library on which matplotlib is installed:
3. For python of Standard Edition, to use matplotlib, you also need to install the numpy module.
4. msvcp71.dll. On some systems, you may need to download the msvcp71.dll library. Download
Decompress the file and drag it to the c: \ windows \ system32 directory.
5. Run a simple program example:
import matplotlib.pyplot as pltplt.plot([1,2,3])plt.ylabel('some numbers')plt.show()
The following error was found:
Raise importerror ("matplotlib requires dateutil ")
Importerror: matplotlib requires dateutil
This requires dateutil. You can download and install it here.
After dateutil is installed, the following error occurs:
Raise importerror ("matplotlib requires pyparsing ")
Importerror: matplotlib requires pyparsing
You need to download and install pyparsing here.
After completing the above steps, run the above example to display our image, as shown below.
If you encounter some dependent packages that need to be installed during program installation, you can find them here, which is indeed a good resource.
You can select the corresponding image in the link below to modify the image you want.
Example: http://matplotlib.org/examples/index.html, Gallery: http://matplotlib.org/gallery.html
Pay attention to the Chinese solution during plotting. Add the following content to the header of the. py file:
- #-*-Coding: UTF-8 -*-
- From pylab import *
- MPL. rcparams ['font. Sans-serif'] = ['simhei'] # specify the default font
- MPL. rcparams ['axes. unicode_minus '] = false # solve the problem of saving the image as a negative sign'-'and displaying it as a square