1차원 분포 플롯
1. 1차원 실수 분포 플롯
1) rugplot
- height : Draw a taller rug
sns.rugplot(data=tips, x="total_bill", y="tip", height=.1)
- hue : Represent a third variable with hue mapping
sns.rugplot(data=tips, x="total_bill", y="tip", hue="time")
- clip_on=False : Put the rug outside the axes
sns.rugplot(data=tips, x="total_bill", y="tip", height=-.02, clip_on=False)
- alpha : Show the density of a larger dataset using thinner lines and alpha blending
sns.rugplot(data=diamonds, x="carat", y="price", lw=1, alpha=.005)
2) kdeplot
- bw_adjust=.2 : Use less smoothing
sns.kdeplot(data=tips, x="total_bill", bw_adjust=.2)
- cut=0 : Use more smoothing, but don’t smooth past the extreme data points
ax= sns.kdeplot(data=tips, x="total_bill", bw_adjust=5, cut=0)
- multiple="stack" : “Stack” the conditional distributions
sns.kdeplot(data=tips, x="total_bill", hue="time", multiple="stack")
- multiple="fill" : Normalize the stacked distribution at each value in the grid
sns.kdeplot(data=tips, x="total_bill", hue="time", multiple="fill")
- fill=True, common_norm=False, palette="crest" : Modify the appearance of the plot
sns.kdeplot( data=tips, x="total_bill", hue="size", fill=True, common_norm=False, palette="crest", alpha=.5, linewidth=0, )
3) distplot
- vertical=True : Plot the distribution on the vertical axis
ax = sns.distplot(x, vertical=True)
- color="y" : Change the color of all the plot elements
sns.set_color_codes()
ax = sns.distplot(x, color="y")
2. 카운트 플롯
1) countplot
- palette="Set3" : Use a different color palette
ax = sns.countplot(x="who", data=titanic, palette="Set3")
- Use matplotlib.axes.Axes.bar() parameters to control the style
ax = sns.countplot(x="who", data=titanic,
facecolor=(0, 0, 0, 0),
linewidth=5,
edgecolor=sns.color_palette("dark", 3))
- catplot : Use catplot() to combine a countplot() and a FacetGrid. This allows grouping within additional categorical variables
g = sns.catplot(x="class", hue="who", col="survived",
data=titanic, kind="count",
height=4, aspect=.7);
cf.
'DA' 카테고리의 다른 글
[seaborn을 이용한 데이터 시각화] #03. barplot, boxplot, pointplot (0) | 2021.07.27 |
---|---|
[seaborn을 이용한 데이터 시각화] #02. jointplot, pairplot, heatmap (0) | 2021.07.26 |
#20. young_survey.csv (0) | 2021.07.22 |
#19. survey.csv (0) | 2021.07.22 |
#18. parks.csv (0) | 2021.07.22 |