0% found this document useful (0 votes)
3 views

Assignment 3

Uploaded by

riteshpc13
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Assignment 3

Uploaded by

riteshpc13
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment 3

Write a python program to draw scatter plot of linear regression.

# importing libraries

import seaborn as sb

# load data

df = sb.load_dataset('iris')

# use regplot

sb.regplot(x = "sepal_length",

y = "petal_length",

ci = None,

data = df)

output:

how to make scatter plots with regression lines using Seaborn in Python.

 Seaborn : Seaborn is a tremendous visualization library for


statistical graphics plotting in Python. It provides beautiful default
styles and color palettes to make statistical plots more attractive. It
is built on the highest of matplotlib library and also closely
integrated to the info structures from pandas.

 Scatter Plot : Scatter plots are wont to observe the relationship


between variables and uses dots to represent the connection
between them. The scatter() method within the matplotlib library is
employed to draw a scatter plot. Scatter plots are widely wont to
represent relationships among variables and the way change in one
affects the opposite.

 Regression Plot : Two main functions in seaborn are wont to


visualize a linear relationship as determined through regression.
These functions, regplot() and lmplot() are closely related and share
much of their core functionality.

Adding a regression curve to a scatterplot between two numerical


variables is a good way to ascertain the linear trend. And we also will see
an example of customizing the scatter plot with a regression curve.

Steps Required

 Import Library (Seaborn)

 Import or load or create data.

 Plot the graph with the help of regplot() or lmplot() method.


Write a python program to draw

You might also like