- 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.
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