Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
57 views
in Information Technology by (49.5k points)
closed by

Customisation of Plots.

1 Answer

+1 vote
by (51.9k points)
selected by
 
Best answer

Pyplot library gives us numerous functions, which can be used to customise charts such as adding titles or legends. 

Some of the customisation options are listed in Table :

List of Pyplot functions to customise plots

Program: Plotting a line chart of date versus temperature by adding Label on X and Y axis, and adding a Title and Grids to the chart.

import matplotlib.pyplot as plt 

date=["25/12","26/12","27/12"] 

temp=[8.5,10.5,6.8] 

plt.plot(date, temp) plt.xlabel("Date") #add the Label on x-axis

plt.ylabel("Temperature") #add the Label on y-axis 

plt.title("Date wise Temperature")   #add the title to the chart 

plt.grid(True)                      #add gridlines to the background 

plt.yticks(temp) 

plt.show()

Line chart as output of Program

In the above example, we have used the xlabel, ylabel, title and yticks functions. We can see that compared to Figure table , the Figure line chart conveys more meaning, easily. We will learn about customisation of other plots in later sections.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...