原文:http://www.cnblogs.com/AndyJee/p/4483043.html There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one candy
在讲解绘制多个子图之前先简单了解一下使用matplotlib绘制一个图,导入绘图所需库matplotlib并创建一个等间隔的列表x,将[0,2*pi]等分为50等份,绘制函数sin(x).当没有给定x轴数值时,默认以下标作为x的值,如果x值确定,则绘图时写为 plt.plot(x,y) . 如若想要绘制一个图时写入标签,则写为 plt.plot(x,y,label="figure1"). from numpy import * import matplotlib.pyplot as p