Home »
Python »
Matplotlib MCQs
Which function is used to set a label for the x-axis in pyplot?
15. Which function is used to set a label for the x-axis in pyplot?
- xlabel()
- set_x()
- x-axis()
- xaxi()
Answer: A) xlabel()
Explanation:
The xlabel() function is used to set a label for the x-axis. Consider the below code statement to set the x-axis.
plt.xlabel("Average Salary")