Informatics Practices
Related Questions
Plot a line chart for depicting the population for the last 5 years as per the specifications given below:
plt.title("My Title") will add a title "My Title" to your plot.
plt.xlabel("Year") will add a label "Year" to your X-axis.
plt.ylabel("Population") will add a label "Population" to your Y-axis.
plt.yticks([1, 2, 3, 4, 5]) set the numbers on the Y-axis to be 1, 2, 3, 4, 5. Pass it and label as a second argument. For example, if we use this code plt.yticks([1, 2, 3, 4, 5], ["1M", "2M", "3M", "4M", "5M"]), it will set the labels 1M, 2M, 3M, 4M, 5M on the Y-axis.
plt.xticks() — works the same as plt.yticks(), but for the X-axis.
What is Matplotlib?
How many types of graphs are plotted using pyplot?
Which function is used to show the graph?