摘要: from matplotlib import pyplot as plt from matplotlib import animation import numpy as np fig, ax = plt.subplots() x = np.arange(0, 2*np.pi, 0.01) line, = ax.plot(x, np.sin(x)) # 接着,构造自定义动画函数animate... 阅读全文
posted @ 2018-09-04 12:10 BothSavage 阅读(637) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 10, 0.1) y1 = 0.05 * x**2 y2 = -1 * y1 fig, ax1 = plt.subplots() #获取figure默认的坐标系 ax1 # 对ax1调用twinx()方法,生成如同镜面效果后的ax2: ax2 = a... 阅读全文
posted @ 2018-09-04 12:06 BothSavage 阅读(547) 评论(0) 推荐(0) 编辑
摘要: # 导入pyplot模块 import matplotlib.pyplot as plt # 初始化figure fig = plt.figure() # 创建数据 x = [1, 2, 3, 4, 5, 6, 7] y = [1, 3, 4, 2, 5, 8, 6] # 接着,我们来绘制大图。首先确定大图左下角的位置以及宽高: left, bottom, width, height ... 阅读全文
posted @ 2018-09-04 12:04 BothSavage 阅读(295) 评论(0) 推荐(0) 编辑
摘要: ax3 = plt.subplot2grid((3,3),(2,0))表示把整个figure分为了三行三列,从第二行第0列开始作图 可以就是用网格作图,方便 阅读全文
posted @ 2018-09-04 12:01 BothSavage 阅读(591) 评论(0) 推荐(0) 编辑
摘要: plt.subplot(2,2,3) 和plt.subplot(223)的效果是一样的 均匀分隔和不均匀分隔的区别 就是subplot前后的参数不一样 阅读全文
posted @ 2018-09-04 11:26 BothSavage 阅读(544) 评论(0) 推荐(0) 编辑
摘要: plt.imshow() 记住有这个东西就行 阅读全文
posted @ 2018-09-04 11:09 BothSavage 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 等有需求的时候再深入研究 阅读全文
posted @ 2018-09-04 10:59 BothSavage 阅读(832) 评论(0) 推荐(0) 编辑
摘要: plt.yticks(())隐藏y的刻度 plt.bar(x,-y2) bar是柱状图 阅读全文
posted @ 2018-09-04 10:46 BothSavage 阅读(237) 评论(0) 推荐(0) 编辑
摘要: plt.scatter(x,y,s=.c=,alpha=)#xy是坐标,s是size,c是颜色,alpha是透明度 阅读全文
posted @ 2018-09-04 10:40 BothSavage 阅读(402) 评论(0) 推荐(0) 编辑