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

Python Expt 9 SBM

The document outlines an experiment aimed at writing a program for creating simple plots using the Matplotlib library in Python. It provides installation instructions, a step-by-step guide on how to create a plot, and descriptions of various functions used in the plotting process. The key functions include .plot(), .show(), .xlabel(), .ylabel(), and others that enhance the visualization of data.

Uploaded by

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

Python Expt 9 SBM

The document outlines an experiment aimed at writing a program for creating simple plots using the Matplotlib library in Python. It provides installation instructions, a step-by-step guide on how to create a plot, and descriptions of various functions used in the plotting process. The key functions include .plot(), .show(), .xlabel(), .ylabel(), and others that enhance the visualization of data.

Uploaded by

dattarajnadkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Jawahar Education Society's

A.C. Patil College of Engineering Kharghar


Department: Electrical Engineering

EXPERIMENT NO.09

AIM: TO WRITE A PROGRAM FOR SIMPLE PLOT USING MATPLOTLIB

Matplotlib is a Python library that helps in visualizing and analyzing the data and helps in better understanding of the data with the help of
graphical, pictorial visualizations that can be simulated using the matplotlib library. Matplotlib is a comprehensive library for static, animated
and interactive visualizations.

Installation of matplotlib library

Step 1: Open command manager (just type “cmd” in your windows start search bar)
Step 2: Type the below command in the terminal.
cd Desktop

Step 3: Then type the following command.


pip install matplotlib

Creating a Simple Plot


Jawahar Education Society's
A.C. Patil College of Engineering Kharghar
Department: Electrical Engineering

Output

The code seems self-explanatory. Following steps were followed:


 Define the x-axis and corresponding y-axis values as lists.
 Plot them on canvas using .plot() function.
 Give a name to x-axis and y-axis using .xlabel() and .ylabel() functions.
 Give a title to your plot using .title() function.
 Finally, to view your plot, we use .show() function.

Method Description

It creates the plot at the background of computer, it doesn’t displays it. We can also add a label as it’s argument that by
plot()
what name we will call this plot – utilized in legend()

show() It displays the created plots

xlabel() It labels the x-axis

ylabel() It labels the y-axis

title() It gives the title to the graph

gca() It helps to get access over the all the four axes of the graph

xticks() It decides how the markings are to be made on the x-axis

yticks() It decides how the markings are to be made on the y-axis

Pass a list as it’s arguments of all the plots made, if labels are not explicitly specified then add the values in the list in the
gca().legend()
same order as the plots are made

annotate() It is use to write comments on the graph at the specified position

You might also like