This article briefly describes the installation of the Python drawing library matplotlib, as follows:
Matplotlib is Python's most famous drawing library, which provides a complete set of command APIs similar to MATLAB and is ideal for interactive
for drawing. Matplotlib installation can see: official website link http://matplotlib.org/users/installing.html
The installation summary steps are as follows:
The Windows platform downloads the. exe format for installation directly.
1.python Download Installation Download address: http://www.python.org/download/.
2. Install the matplotlib you need (this is based on the Python version of Step 1), download the address: http://matplotlib.org/downloads.html.
Install the Matplotlib dependent libraries below
3. For the standard version of Python, to use matplotlib, you also need to install the NumPy module, the download address is: http://sourceforge.net/projects/numpy/files/NumPy/.
4.msvcp71.dll, on some systems, you may also need to download the Msvcp71.dll library. Download Address: http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71
Download the decompression and drag it to the C:\Windows\System32 directory.
5. Run a simple program example:
View plaincopy The code slice to my code.
Import Matplotlib.pyplot as Plt
plt.plot ([1,2,3])
Plt.ylabel (' some numbers ')
plt.show ()
Errors encountered by the installation process
The following error was found:
Raise Importerror ("Matplotlib requires Dateutil")
Importerror:matplotlib requires Dateutil
This needs dateutil, you can download the installation here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil.
The following error occurred after installing the Dateutil:
Raise Importerror ("Matplotlib requires pyparsing")
Importerror:matplotlib requires pyparsing
need to pyparsing here to download the installation: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing.
To complete the above steps, run the example above to display our image, as shown below.
If you encounter some dependent packages that need to be installed during program installation, you can find http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing here, which is a really good resource.
According to the needs of the drawing in the following link to select the appropriate graphics to modify, to draw their own images needed.
Example:http://matplotlib.org/examples/index.html, gallery:http://matplotlib.org/gallery.html
Related Resources Links:
Matplotlib Tutorial The http://reverland.org/python/2012/09/07/matplotlib-tutorial/of Chinese translation.
Use Python to do scientific calculations http://sebug.net/paper/books/scipydoc/index.html.
Resource Downloads:
If the above cannot be downloaded. I put the software required to install the Python matplotlib on the Baidu network, you can come here: http://pan.baidu.com/s/1i3C99rv.
Chinese garbled resolution method
Note the solution to the Chinese language when drawing, adding the following on the head of the. py file:
#-*-Coding:utf-8-*-from
pylab import * mpl.rcparams[' Font.sans-serif '
] = [' Simhei '] #指定默认字体
mpl.rcparams[' axes.unicode_minus ' = False #解决保存图像是负号 '-' the problem that appears as a box
Drawing script. py to. exe
If you want to be able to publish your Python scripts as executable programs that run off the Python platform, such as a single EXE file. Refer to this blog post: http://blog.csdn.net/daniel_ustc/article/details/15501385
Using a portable Python environment
Python programming language under the mobile device operating environment and programming language environment, portable Python is a Python programming language that runs directly from any USB storage device, so that at any time you have a portable programming environment. Make it very convenient, recommended use.