seaborn.scatterplot学习

官方文档 

seaborn scatterplot

seaborn.scatterplot(*x=Noney=Nonehue=Nonestyle=Nonesize=Nonedata=Nonepalette=Nonehue_order=Nonehue_norm=Nonesizes=Nonesize_order=Nonesize_norm=Nonemarkers=Truestyle_order=Nonex_bins=Noney_bins=Noneunits=Noneestimator=Noneci=95n_boot=1000alpha=Nonex_jitter=Noney_jitter=Nonelegend='auto'ax=None**kwargs)

参数真多

Draw a scatter plot with possibility of several semantic groupings.

The relationship between x and y can be shown for different subsets of the data using the huesize, and style parameters. These parameters control what visual semantics are used to identify the different subsets. It is possible to show up to three dimensions independently by using all three semantic types, but this style of plot can be hard to interpret and is often ineffective. Using redundant semantics (i.e. both hue and style for the same variable) can be helpful for making graphics more accessible.

import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
tips = sns.load_dataset("tips")
# print(tips.keys)
# total_bill tip sex smoker day time size
print(tips.head())

# sns.scatterplot(data = tips, x="total_bill", y="tip")
sns.scatterplot(data = tips, x = "total_bill", y = "tip", hue = "sex",style = "sex")
# sns.scatterplot(data = tips, x = "total_bill", y = "tip", hue = "time", style = "time")
plt.show()

 

 

Guess you like

Origin blog.csdn.net/moonlightpeng/article/details/120764357