Home  >  Article  >  Backend Development  >  matplotlib-python drawing-conversion-tested

matplotlib-python drawing-conversion-tested

巴扎黑
巴扎黑Original
2016-12-07 09:25:551527browse

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() 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn