Articles → Matplotlib → Set Xlabel, Ylabel And Title Of The Graph In Matplotlib

Set Xlabel, Ylabel And Title Of The Graph In Matplotlib






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)

#Set XLabel, yLabel and Title
plt.xlabel("XLabel")
plt.ylabel("YLabel")
plt.title("My Title")
plt.show()



Output


Picture showing how to set xLabel, yLabel and title of the graph in matplotlib



Posted By  -  Karan Gupta
 
Posted On  -  Friday, May 24, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250