Installation of Matplotlib in python Drawing Library

Source: Internet
Author: User
Tags install matplotlib matplotlib tutorial

This article briefly introduces the installation of Matplotlib In the Python Drawing Library. The introduction is as follows:

Matplotlib is the most famous Drawing Library in python. It provides a complete set of command APIs similar to matlab and is very suitable for interactive scenarios.
. Matplotlib installation can see: the official website link http://matplotlib.org/users/installing.html

The installation procedure is as follows:

Download the. exe file on the windows platform and install it directly.

1. Download and install python: http://www.python.org/download /.
2. Install Matplotlib, http://matplotlib.org/downloads.html.
The following is the library on which Matplotlib is installed:
3. For Python Standard Edition, to use Matplotlib, you also need to install the numpy module: http://sourceforge.net/projects/numpy/files/numpy /.
4. msvcp71.dll. On some systems, you may need to download the msvcp71.dll library. : Http://www.dll-files.com/dllindex/dll-files.shtml? Msvcp71
Download and decompress the package and drag it to the c: \ windows \ system32 directory.
5. Run a simple program example:
 
View plaincopy view the CODE piece derived from my CODE piece on the CODE

import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.ylabel('some numbers') plt.show()

Installation errors
The following error was found:
Raise ImportError ("matplotlib requires dateutil ")
ImportError: matplotlib requires dateutil
This requires dateutil, you can download the installation here: http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# python-dateutil.

After dateutil is installed, the following error occurs:
Raise ImportError ("matplotlib requires pyparsing ")
ImportError: matplotlib requires pyparsing
Need pyparsing here download installation: http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# pyparsing.

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 the installation process, you can find the http://www.lfd.uci.edu here /~ Gohlke/pythonlibs/# pyparsing, 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
Related resource links:
Matplotlib Tutorial Chinese translation http://reverland.org/python/2012/09/07/matplotlib-tutorial.
Scientific Computing http://sebug.net/paper/books/scipydoc/index.html with Python.

Download resources:
If it cannot be downloaded. I have placed the software required to install python matplotlib on the Baidu network disk. You can go here: http://pan.baidu.com/s/1i3c99rv.

Chinese garbled code Solution

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

Convert the drawing script. py to. exe.

If you want to release the Python script as an executable program that is not running on the Python platform, such as a single exe file. Can refer to this blog: http://blog.csdn.net/daniel_ustc/article/details/15501385

Use a portable Python Environment

Python programming language is the runtime environment and programming language environment of mobile devices. Portable Python is a Python programming language that runs directly from any USB storage device in advance, so that at any time, you have a portable programming environment. It is easy to use and is recommended for 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.