ITeye博客

matplotlib-python 画图-转-已测试

cuityang · 2016-12-06 21:22 · python · 编程语言 · Markdown

import numpy as np import matplotlib.pyplot as plt plt.figure(1) plt.figure(2) ax1 = plt.subplot(211) ax2 = plt.subplot(212) x = np.linspace(0, 3, 100) for i in xrange(5): plt.figure(1)
plt.plot(x, np.exp(ix/3)) plt.sca(ax1)
plt.plot(x, np.sin(i
x)) plt.sca(ax2)
plt.plot(x, np.cos(i*x)) plt.show()

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。