How to Draw Line Plot in Seaborn

Free Machine Learning courses with 130+ real-time projects Start Now!!

Program 1

# # Application of SeaBorn

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns


#using Matplot lib
days=[1,2,3,4,5,6,7,8,9,10]
ind_temp=[34.4,23.4,45.4,24.4,34.4,36.2,44.4,33.2,28.7,33.5]
plt.plot(days,ind_temp)
plt.xlabel("Days");
plt.ylabel("Temperature");
plt.title("Indore Temperature")
plt.show()


#using Seaborn lib
days=[1,2,3,4,5,6,7,8,9,10]
ind_temp=[34.4,23.4,45.4,24.4,34.4,36.2,44.4,33.2,28.7,33.5]
df=pd.DataFrame({"Days":days,"Temperature":ind_temp})
sns.lineplot(x="Days",y="Temperature",data=df)
plt.show()



df_emp=pd.read_excel("D://scikit_data/emp/employee.xlsx")


df_emp


#sns.lineplot(x="Experience",y="Salary",data=df_emp)

sns.lineplot(x=df_emp['experience'],y=df['salary'],data=df_emp)
plt.show()

 

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *