Height-Vs-Weight

Sat 17 May 2025
!python --version
Python 3.10.5
# !pip install seaborn
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
data = {
    "Height": [150, 160, 165, 170, 175, 180, 185],
    "Weight": [50, 60, 65, 70, 75, 80, 85],
    "Gender": ["Female", "Male", "Female", "Male", "Female", "Male", "Female"]
}
df = pd.DataFrame(data)
sns.set(style="whitegrid")
plt.figure(figsize=(8, 6))
scatter_plot = sns.scatterplot(data=df, x="Height", y="Weight", hue="Gender", style="Gender", s=100)

plt.title("Height vs. Weight by Gender", fontsize=16)
plt.xlabel("Height (cm)", fontsize=12)
plt.ylabel("Weight (kg)", fontsize=12)
plt.legend(title="Gender")
plt.show()

png




Score: 5

Category: seaborn


Tips-Seaborn

Sat 17 May 2025
!python --version
Python 3.10.5
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
# Load the dataset
tips = sns.load_dataset("tips")
# Create a PairGrid with regression and histogram plots
g = sns.PairGrid(tips, diag_sharey=False, hue="sex", palette="Set2")
g.map_upper(sns.scatterplot, alpha=0 …

Category: seaborn

Read More

Two

Sat 17 May 2025
!python --version
Python 3.10.5
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
# Load the dataset
tips = sns.load_dataset("tips")
# Create a PairGrid with regression and histogram plots
g = sns.PairGrid(tips, diag_sharey=False, hue="sex", palette="Set2")
g.map_upper(sns.scatterplot, alpha=0 …

Category: seaborn

Read More
Page 1 of 1