Installation of the Python drawing library matplotlib

Source: Internet
Author: User
Tags matplotlib tutorial
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 those of MATLAB, and is ideal for interactive
For mapping. Matplotlib installation can be found at: Website Link http://matplotlib.org/users/installing.html

The installation summary steps are as follows:

The Windows platform downloads the. exe format to install directly.

1.python Download Install download address: http://www.python.org/download/.
2. Install the version you need (this will be based on the Python version of Step 1) matplotlib, download address: http://matplotlib.org/downloads.html.
Install the Matplotlib dependent libraries below
3. For the standard version of Python, to use Matplotlib, you will also need to install the NumPy module with the download address: 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 extract and drag it to the C:\Windows\System32 directory.
5. Run a simple program example:

View Plaincopy on code to see a snippet derived from my Code slice

Import Matplotlib.pyplot as Plt Plt.plot ([]) Plt.ylabel (' Some numbers ') plt.show ()

Errors encountered during the installation
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.

After installing the Dateutil, the following error occurred:
Raise Importerror ("Matplotlib requires pyparsing")
Importerror:matplotlib requires pyparsing
Need pyparsing here to download installation: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing.

Complete the above steps and run the example above to display our images as shown below.

If you encounter some dependencies that you need to install during the program installation, you can find http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing here, which is indeed a good resource.

According to the need to draw the graphics in the following link to select the corresponding graphic to modify, to draw their own images required.
Example:http://matplotlib.org/examples/index.html, gallery:http://matplotlib.org/gallery.html
Related Resources Link:
Matplotlib Tutorial The http://reverland.org/python/2012/09/07/matplotlib-tutorial/of Chinese translation.
Use Python to make scientific calculations http://sebug.net/paper/books/scipydoc/index.html.

Resources Download:
If the above cannot be downloaded. I put the necessary software to install Python matplotlib to Baidu network disk, you can go here: http://pan.baidu.com/s/1i3C99rv.

How to solve Chinese garbled characters

Note the resolution for Chinese in drawing, add the following to the header of the. py file:

#-*-Coding:utf-8-*-from pylab import * mpl.rcparams[' font.sans-serif '] = [' Simhei '] #指定默认字体 mpl.rcparams[' axes.unicod E_minus '] = False #解决保存图像是负号 '-' is displayed as a block problem

Drawing script. py to. exe

If you want to be able to publish a Python script as an executable program running out of the Python platform, such as a single EXE file. You can 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 pre-run directly from any USB storage device, so that at any time you have a portable programming environment. It is very convenient to make it up, recommended to use.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.