Use the subplot

. 1  Import matplotlib.pyplot AS PLT 
 2  Import numpy AS NP 
 . 3  # canvas partitions, mapping specified region 
. 4 X = np.linspace (1,10,100 )
 . 5  # canvas into 2x2 
. 6 plt.subplot (2,2,1 )
 7  # modify x, y-axis coordinate 
. 8 plt.xlim (-5,20 )
 . 9 plt.ylim (-2,2 )
 10  plt.plot (X, np.sin (X))
 . 11 plt.subplot (2 , 2,4 )
 12 is  plt.plot (X, np.cos (X))
 13 is plt.show ()

 

 

 

Guess you like

Origin www.cnblogs.com/monsterhy123/p/12642426.html
use