Matplotlib and matplotlib

Source: Internet
Author: User

Matplotlib and matplotlib

Legend reference: http://matplotlib.org/gallery.html

 

API reference: http://matplotlib.org/api/pyplot_summary.html

 

#-*-Coding: UTF-8-*-"" Simple demo with multiple subplots. "import numpy as npimport matplotlib. pyplot as pltx1 = np. linspace (0.0, 5.0) x2 = np. linspace (0.0, 2.0) y1 = np. cos (2 * np. pi * x1) * np. exp (-x1) y2 = np. cos (2 * np. pi * x2) # The first large graph plt. subplot (2, 1, 1) # plt. plot (x1, y1, 'ro-') plt. title ('A tale of 2 subplots') plt. ylabel ('damped oscillation') plt. subplot (2, 1, 2) plt. plot (x2, y2 ,'. -') plt. xlabel ('time (s) ') plt. ylabel ('undamped ') plt. figure (2) # The second large graph plt. plot (x1, y1, 'O-', label = "line1") # Add label description plt. plot (x2, y2 ,'. -', label = 'line2') # Add a label to indicate plt. axis ([0, 5,-1, 1]) # specify the coordinate system plt. legend (loc = 'best', ncol = 1, prop = {'SIZE': 16}, columnspacing = 0.5) # add remarks, loc location, plt. title ("title") plt. xlabel ("xlabel") plt. ylabel ("ylabel") plt. show ()

 

 

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.