Scatter Plot in Seaborn

Machine Learning courses with 100+ Real-time projects Start Now!!

Program 1

Seaborn Dataset

# Scatter Plot Demo|


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


df_titanic=sns.load_dataset('titanic')

df_titanic.head()


df_titanic.info()


df_titanic.shape


df_titanic.isnull().sum()


sns.scatterplot(x='age',y='fare',data=df_titanic)


sns.scatterplot(x='age',y='fare',hue='sex',data=df_titanic)


sns.scatterplot(x='age',y='fare',hue='sex',style='who',data=df_titanic)


plt.figure(figsize=(15,10))
sns.scatterplot(x='age',y='fare',hue='sex',style='who',size='who',data=df_titanic)


plt.figure(figsize=(15,10))
sns.scatterplot(x='age',y='fare',hue='sex',style='who',size='who',sizes=(100,500),data=df_titanic)


plt.figure(figsize=(15,10))
sns.scatterplot(x='who',y='fare',hue='alive',style='alive',size='who',data=df_titanic)

 

Your 15 seconds will encourage us to work even harder
Please share your happy experience 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 *