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 ()