摘要: import numpy as np from matplotlib import pyplot as plt from matplotlib import animation fig, ax = plt.subplots() x = np.arange(0, 2*np.pi, 0.01) prin 阅读全文
posted @ 2020-01-12 21:47 岑夫子 阅读(1038) 评论(0) 推荐(0) 编辑
摘要: 一: fig.add_axes 画图中图 fig = plt.figure() x = np.arange(1, 9, 1) y = np.linspace(1, 10, 8) left, bottom, width, height = 0.1, 0.1, 0.8, 0.8 ax1 = fig.ad 阅读全文
posted @ 2020-01-12 21:18 岑夫子 阅读(1597) 评论(0) 推荐(0) 编辑
摘要: 1:第一种方法 # method1: subplot2grid ################# ''' 第一个参数(3, 3) 是把图分成3行3列 第二个参数是位置 (0, 0)表示从0行0列开始 第三个参数 colspan=3 表示列占3列 , 第四个参数 rowspan=1 表示行占一行 ' 阅读全文
posted @ 2020-01-12 17:45 岑夫子 阅读(812) 评论(0) 推荐(0) 编辑
摘要: import numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = Axes3D(fig) x = np.arange(-4, 4, 0.25 阅读全文
posted @ 2020-01-12 17:24 岑夫子 阅读(1369) 评论(0) 推荐(0) 编辑
摘要: numpy库提供非常便捷的数组运算,方便数据的处理。 1、数组与标量之间可直接进行运算 In [45]: aOut[45]:array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) In [46]: a/5Out[46]:array([[ 0. , 阅读全文
posted @ 2020-01-12 15:03 岑夫子 阅读(3169) 评论(0) 推荐(0) 编辑
摘要: 一:散点图: scatter函数原型 其中散点的形状参数marker如下: 其中颜色参数c如下: n = 1024 # 均值是0, 方差是1, 取1024个数 x = np.random.normal(0, 1, n) y = np.random.normal(0, 1, n) # 设置颜色值 T 阅读全文
posted @ 2020-01-12 14:52 岑夫子 阅读(777) 评论(0) 推荐(0) 编辑