table of Contents
Reference source: Seaborn official document
1. Introduction & Framework
1.1 The relationship between Seaborn and Matplotlib
- Matplotlib is a practical and popular data visualization tool;
- Seaborn is a powerful API developed on the basis of Matplotlib, which is very convenient; to
put it bluntly, Matplotlib is the bottom layer of Seaborn.
1.2 Advantages of Seaborn
- Have more and more modern styles and artistic effects;
- Added more statistical-based, simpler and more convenient advanced functions;
- Can be seamlessly combined with Pandas DataFrame.
Attachment: Comparison of drawing styles
- Matplotlib drawing style:
- seaborn drawing style (default):
- Seaborn drawing style (after setting the style):
sns.set() # 默认 style='darkgrid'
Note: Once sns.set() is set, it will be changed globally, only restart can be modified (also pay attention to the difference between matplotlib and seaborn)
1.3 Framework (understanding)
The whole article is divided into three parts:
1. Plotting functions
2. Multi-plot grids
3. Plot aesthetics
At present, I mainly focus on the first part. The plotting functions include the relplot() function for most continuous numerical variable operations, and the catplot() for a large amount of categorical (discrete) data. The second and third parts need to be improved. .
2. Drawing functions
2.1 Visualized statistical relationship
2.1 Visualized statistical relationship: sns.relplot()
Mainly the relationship analysis function sns.relplot()]
2.2 Visualizing classification data
2.2 Visualizing classification data: sns.catplot()
Mainly the classification visualization function sns.catplot()
2.3 Data distribution of visualized data set
2.3 Data distribution of visualized data set
Mainly univariate analysis function distplot(), binary distribution function jointplot() and matrix graph pairplot()
2.4 Visualizing linear relationships
2.4 Visualizing linear relationships
Mainly regplot() and lmplot() functions.
3. Multi-image grid
4. Image aesthetics/drawing settings
5. Summary
reference: