Python's Scientific Computing package Matplotlib Setup

Source: Internet
Author: User
Tags install matplotlib

    • Recalling the University for four years

Professional has been using MATLAB, but I did not install the success of the PC, formerly lazy to think about the role of this mathematical tool, until recently, the university students to graduate, after several exchanges, and their own reading some of the machine learning materials, found that the scientific calculation package and drawing tools for some posts is very necessary, Because of the use of mathematical modeling and design of various industrial design drawings, the parameters need to be modulated drawing observation effect. Although I have not touched the actual scene, but in the perspective of probability theory, some discrete sets of digital characteristics (expectation, variance), etc., in the image of the performance, can also be aided by this scientific calculation package analysis.

    • Set up

The first step

Download a 3.6 package on the Python website and don't know from 3. Starting with multiple versions, Python starts to support PIP and is easy to install with PIP. It is best to use Windows systems, because this scientific computing package does a lot of math analysis, rather than doing the functions, and does not necessarily have to run on Linux. Python official website

    Step Two

Install, and set environment variables. This is done primarily by adding a Python installation path after path. Graphic please Baidu.

Step Three

After you have determined that CMD can be entered in Python, use the command to install Matplotlib

Install matplotlib

After the installation is complete, write a demo and draw two triangular function lines.

#!/usr/bin/python#Import Paint Packages fromPylabImport*#Create a new 8 * 6-point chart with a resolution ofFigure (Figsize= (8,6), dpi=80)#Create a new 1 * 1 sub-graphSubplot (1,1,1) X=np.linspace (-np.pi,np.pi,256,endpoint=True) C=Np.cos (X) S=Np.sin (X)#draw cosine with blue continuous width 1Plot (x,c,color='Blue', linewidth=1.0,linestyle='-')#draw sine with green continuous width 1Plot (x,s,color='Green', linewidth=1.0,linestyle='-')#set upper and lower bounds on the horizontal axisXlim ( -4.0,4.0)#Set Horizontal axis notationXticks (Np.linspace ( -4,4,9,endpoint=True))#set upper and lower limits on the vertical axisYlim ( -1.0,1.0)#Set Horizontal axis notationYticks (Np.linspace ( -1,1,5,endpoint=True))#ShowShow ()

Follow-up learning continues to update ....

Python's Scientific Computing package Matplotlib Setup

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.