# -*- coding: gb2312 -*- import matplotlib.pyplot as plt fig=plt.figure() ax=fig.add_subplot(2,2,1) ax=fig.add_subplot(2,2,2) ax=fig.add_subplot(2,2,3) ax=fig.add_axes([0.2,0.4,0.2,0.4]) for i in fig.axes: #依次获取每一个子图 i.plot([1,2],[2,3]) t=fig.gca()#获取当前子图 t.scatter([5,2],[6,2],c=‘r‘) plt.show()
原文:http://www.cnblogs.com/sklww/p/3692962.html