SEABORN Visualizations
SEABORN Visualizations
# Quick preview
print(data.head())
1. Simple Plots
2. Intermediate Plots
3. Advanced Plots
a. Violin Plot
sns.violinplot(data=data, x='category_column', y='numeric_column') # Replace
with column names
plt.title("Violin Plot")
plt.show()
Key Points:
Replace placeholder column names (column_name, x_column, y_column, etc.) with actual
column names from your dataset.
Use data.info() or data.head() to understand your data structure and identify column
types.
Gradually explore these plots depending on the complexity and insights needed.
1. Set Themes
Seaborn has built-in color palettes that you can use for a variety of effects:
Default: deep
Sequential: Blues, Reds, etc.
Diverging: coolwarm, seismic, etc.
Qualitative: Set1, Set2, Pastel1, etc.
Always include descriptive titles, axis labels, and legends for clarity.
# Load dataset
data = pd.read_csv("your_dataset.csv") # Replace with your file
# Heatmap
plt.figure(figsize=(12, 8))
sns.heatmap(data.corr(), annot=True, fmt=".2f", cmap="coolwarm",
linewidths=0.5)
plt.title("Correlation Heatmap", fontsize=18)
plt.show()