作者:fggdsfgwjff4 | 来源:互联网 | 2023-10-13 12:27
转载:http:seaborn.pydata.orgexamplesscatterplot_sizes.htmlScatterplotwithcontinuoushu
转载:http://seaborn.pydata.org/examples/scatterplot_sizes.html
Scatterplot with continuous hues and sizes代码:
import seaborn as sns
sns.set_theme(style="whitegrid")
planets = sns.load_dataset("planets")cmap = sns.cubehelix_palette(rot=-.2, as_cmap=True)
g = sns.relplot(data=planets,x="distance", y="orbital_period",hue="year", size="mass",palette=cmap, sizes=(10, 200),
)
g.set(xscale="log", yscale="log")
g.ax.xaxis.grid(True, "minor", linewidth=.25)
g.ax.yaxis.grid(True, "minor", linewidth=.25)
g.despine(left=True, bottom=True)