Scatterplot with continuous hues and sizesΒΆ

../_images/scatterplot_sizes.png

Python source code: [download source: scatterplot_sizes.py]


import seaborn as sns
sns.set()

# Load the example planets dataset
planets = sns.load_dataset("planets")

cmap = sns.cubehelix_palette(rot=-.2, as_cmap=True)
ax = sns.scatterplot(x="distance", y="orbital_period",
                     hue="year", size="mass",
                     palette=cmap, sizes=(10, 200),
                     data=planets)