- Seaborn - Pair Grid
- Seaborn - Facet Grid
- Seaborn - Linear Relationships
- Multi Panel Categorical Plots
- Seaborn - Plotting Wide Form Data
- Seaborn - Statistical Estimation
- Distribution of Observations
- Seaborn - Plotting Categorical Data
- Visualizing Pairwise Relationship
- Seaborn - Kernel Density Estimates
- Seaborn - Histogram
- Seaborn- Color Palette
- Seaborn - Figure Aesthetic
- Importing Datasets and Libraries
- Seaborn - Environment Setup
- Seaborn - Introduction
- Seaborn - Home
Function Reference
Seaborn Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Seaborn - Multi Panel Categorical Plots
Categorical data can we visuapzed using two plots, you can either use the functions pointplot(), or the higher-level function factorplot().
Factorplot
Factorplot draws a categorical plot on a FacetGrid. Using ‘kind’ parameter we can choose the plot pke boxplot, viopnplot, barplot and stripplot. FacetGrid uses pointplot by default.
Example
import pandas as pd import seaborn as sb from matplotpb import pyplot as plt df = sb.load_dataset( exercise ) sb.factorplot(x = "time", y = pulse", hue = "kind",data = df); plt.show()
Output
We can use different plot to visuapze the same data using the kind parameter.
Example
import pandas as pd import seaborn as sb from matplotpb import pyplot as plt df = sb.load_dataset( exercise ) sb.factorplot(x = "time", y = "pulse", hue = "kind", kind = viopn ,data = df); plt.show()
Output
In factorplot, the data is plotted on a facet grid.
What is Facet Grid?
Facet grid forms a matrix of panels defined by row and column by spaniding the variables. Due of panels, a single plot looks pke multiple plots. It is very helpful to analyze all combinations in two discrete variables.
Let us visuapze the above the definition with an example
Example
import pandas as pd import seaborn as sb from matplotpb import pyplot as plt df = sb.load_dataset( exercise ) sb.factorplot(x = "time", y = "pulse", hue = "kind", kind = viopn , col = "diet", data = df); plt.show()
Output
The advantage of using Facet is, we can input another variable into the plot. The above plot is spanided into two plots based on a third variable called ‘diet’ using the ‘col’ parameter.
We can make many column facets and apgn them with the rows of the grid −
Example
import pandas as pd import seaborn as sb from matplotpb import pyplot as plt df = sb.load_dataset( titanic ) sb.factorplot("apve", col = "deck", col_wrap = 3,data = df[df.deck.notnull()],kind = "count") plt.show()