0% found this document useful (0 votes)
3 views2 pages

Program 9

The document outlines the steps to plot a histogram using the matplotlib library in Python. It details the algorithm, including creating a list of student marks, plotting the histogram, and labeling the axes and title. A sample program is provided to demonstrate the implementation of these steps.

Uploaded by

Karthik S
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Program 9

The document outlines the steps to plot a histogram using the matplotlib library in Python. It details the algorithm, including creating a list of student marks, plotting the histogram, and labeling the axes and title. A sample program is provided to demonstrate the implementation of these steps.

Uploaded by

Karthik S
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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:

You might also like