# 14.3 hue आणि boxplot

Source: https://ravindrabagale.com/mr/datascience/ch14-visualization-with-seaborn/14-3-hue-and-boxplot.html
Language: mr (Marathi with English technical terms)

hue="status" मुळे प्रत्येक city मधल्या statuses वेगळ्या colors मध्ये दिसतात:

fig, ax = plt.subplots(figsize=(8, 4))
sns.countplot(data=df, x="city", hue="status", ax=ax)
ax.set_title("City × status counts (fictional)")
plt.xticks(rotation=30, ha="right")
fig.tight_layout()
plt.show()

Amount चा spread पाहण्यासाठी boxplot वापरू:

fig, ax = plt.subplots()
sns.boxplot(data=df, x="festival", y="amount", ax=ax)
ax.set_title("Amount spread by festival (fictional)")
plt.show()

Jupyter मध्ये steps

sns.set_theme(style="whitegrid") run करा.

City चा countplot करा.

Festival नुसार mean amount चा barplot करा.

hue="status" असलेला countplot करा.

तो chart figures/seaborn_city_status.png मध्ये save करा.

या छोट्या sample मध्ये Diwali mean amount जास्त दिसेल. Hue chart मध्ये Cancelled फक्त Kolhapur खाली दिसतो.

रवींद्र बागले यांची tip

प्रत्येक category साठी loop लिहायची गरज नाही; hue ते काम करतो. barplot चा default estimator mean आहे. Sum हवी असेल तर estimator="sum" द्या.
