9.
PLOTTING HISTOGRAM
Aim:
To plot a histogram based on the input given.
Algorithm:
Step 1: Start the process.
Step 2: Install matplotlib library and import it in the program.
Step 3: Create a list named marks which stores the marks obtained by all students in a particular
subject.
Step 4: Use the hist( ) function to plot the histogram using the marks stored in the list and use bin
parameter to specify the number of bins in which the given data is to be split.
Step 5: Use xlabel( ) and ylabel( ) functions to specify the x-axis and y-axis labels.
Step 6: Use the title( ) function to specify the title for the histogram.
Step 7: Save the program and display the result.
Step 8: Stop the process.
Program:
import [Link] as plt
marks = [88,100,75,67,93,73,56,95,84,92,82,58,50]
[Link](marks, bins=5, color='skyblue', edgecolor='black')
[Link]('Marks')
[Link]('Frequency')
[Link](‘Marks Distribution Histogram’)
[Link]()
OUTPUT: