精选优质文档-倾情为你奉上一、导入1.导入matplotlib库简写为pltimport matplotlib.pyplot as plt二、基本图表2.用plot方法画出x=(0,10)间sin的图像x = np.linspace(0, 10, 30)plt.plot(x, np.sin(x);3.用点加线的方式画出x=(0,10)间sin的图像plt.plot(x, np.sin(x), -o);4.用scatter方法画出x=(0,10)间sin的点图像plt.scatter(x, np.sin(x);5.用饼图的面积及颜色展示一组4维数据rng = np.random.RandomState(0)x = rng.randn(100)y = rng.randn(100)colors = rng.rand(100)sizes = 1000 * rng.rand(100)plt.scatter(x, y, c=colors, s=sizes, alpha=0.3, cmap=vir