Articles → Matplotlib → subplot function in matplotlib

subplot function in matplotlib






Purpose











Click to Enlarge




Syntax


Pyplot_object.subplot(m, n, p)











Example 1


import matplotlib.pyplot as plt
import array 


arr1 = array.array('i', [1, 2, 3])
arr2 = array.array('i', [4, 5, 6])

plt.subplot(2,2,3)
plt.plot(arr1,arr2)

plt.show()





Click to Enlarge


Example 2


import matplotlib.pyplot as plt
import array 


arr1 = array.array('i', [1, 2, 3])
arr2 = array.array('i', [4, 5, 6])

plt.subplot(2,2,3)
plt.plot(arr1,arr2)

plt.subplot(2,2,4)
plt.plot(arr1,arr2)

plt.show()





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, May 28, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250