Seaborn
Seaborn
Seaborn is a powerful data visualization tool that allows you to create attractive and informative
visualizations with just a few lines of code. Let's return to this diagram of the data analysis workflow to
see where Seaborn fits in.
Getting started: Import Seaborn (import seaborn as sns) and Matplotlib (import matplotlib.pyplot as
plt). Use plt.show() to display the visualization.
Relational plots: These show relationships between two quantitative variables. Use relplot() with x
and y variables, DataFrame, and plot type (scatter or line).
Categorical plots: These describe the distribution of a quantitative variable across categories. Use
catplot() with x, y (if applicable), DataFrame, and plot type (bar, count, box, point).
Adding a third variable (hue): The "hue" parameter adds color-coded subgroups to a plot based on a
third variable.
Adding a third variable (row/col): You can create subplots for each subgroup using the col and row
parameters in relplot() or catplot().
Customization: Customize appearance using sns.set_style for background white", "dark", "whitegrid",
"darkgrid", "ticks,
sns.set_palette for color
sns.set_context for plot scale.
Adding a title: Add titles and axis labels to FacetGrid or AxesSubplot objects.
Final touches: Use set() to add x- and y-axis labels and plt.xticks(rotation=...) to rotate tick labels.
NOTE: Replot() an catplot() used bec its mote flexable and can esily create subplots using col , row
parameters
Bar plot display means of quantitative variables nit like count plot display count