matplotlib-python画图-转-已测试
来源:动视网
责编:小采
时间:2020-11-27 14:27:32
matplotlib-python画图-转-已测试
matplotlib-python画图-转-已测试: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(i*x/3)) plt.sca(ax1) plt.plot(x
导读matplotlib-python画图-转-已测试: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(i*x/3)) plt.sca(ax1) plt.plot(x

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(i*x/3))
plt.sca(ax1)
plt.plot(x, np.sin(i*x))
plt.sca(ax2)
plt.plot(x, np.cos(i*x))
plt.show()
matplotlib-python画图-转-已测试
matplotlib-python画图-转-已测试: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(i*x/3)) plt.sca(ax1) plt.plot(x