Use of Python matplot (i)

Source: Internet
Author: User

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)

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.