Articles → Matplotlib → Xlabel, Ylabel And Suptitle Function In Matplotlib
Xlabel, Ylabel And Suptitle Function In Matplotlib
Purpose
- xlabel specifies label of X axis.
- Ylabel specifies label of Y axis.
- Suptitle specifies the title of the graph.
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, marker="o")
plt.xlabel("X Label")
plt.ylabel("Y Label")
plt.suptitle("Test Title")
plt.show()
Output