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
2.6k views
in Information Technology by (72.8k points)
closed by

The heights of 10 students of eighth grade are given below:

Height_cms = [145,141,142,142,143,144,141,140,143,144]

Write suitable Python code to generate a histogram based on the given data, along with an appropriate chart title and both axis labels. Also give suitable python statement to save this chart.

1 Answer

+1 vote
by (62.5k points)
selected by
 
Best answer
import matplotlib.pyplot as plt #Statement 1
Height_cms = [145,141,142,142,143,143,141,140,143,144]
                                              #Statement 2
plt.hist(Height_cms)                          #Statement 3
plt.title("Height Chart")                     #Statement 4
plt.xlabel("Height in cms")                   #Statement 5
plt.ylabel("Number of people")                #Statement 6
plt.show()                                   #Statement 7

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

...