In fact, the direct reason to use it is because MATLAB is too big, inconvenient. In addition, it is free of charge.
When you install this library, you will need to install some of the libraries it depends on, such as six. Download from SourceForge, just follow the prompts to complete the installation.
Below is the first Matplot example of a drawing, in which the mathematical convenience of things mainly used numpy things. Very simple! and matlab too like ~ ~
1 ImportNumPy as NP2 ImportMatplotlib.pyplot as Plt3 4x = Np.linspace (0, 10, 1000)#points5y =np.sin (x)6z = Np.cos (x**2)7 8Plt.figure (figsize= (8,4))9Plt.plot (x,y,label="$sin (x) $", color="Red", linewidth=2)TenPlt.plot (X,z,"g--", label="$cos (x^2) $", linewidth=1.5) OnePlt.xlabel ("Time (s)") APlt.ylabel ("Value") -Plt.title ("My First example") -Plt.ylim ( -1.5,1.5) the plt.legend () -Plt.show ()View Code
The results of the operation are as follows:
Use of Python matplot (i)