Articles → Matplotlib → plot function in matplotlib

plot function in matplotlib






Purpose





Example


import matplotlib.pyplot as plt
import array 


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

plt.plot(arr1,arr2)
plt.show()



Output


Click to Enlarge


Specifying the color of the graph




import matplotlib.pyplot as plt
import array 


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

plt.plot(arr1,arr2,"y")
plt.show()




Click to Enlarge



import matplotlib.pyplot as plt
import array 


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

plt.plot(arr1,arr2,"#2A2D32")
plt.show()


Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, May 22, 2019
 
Updated On  -  Wednesday, June 05, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250