There are two main things I would like to do for my scatterplot in seaborn.
- Change the Legend Title and remove the series name from the legend. So remove the
petal_length
that appears in legend - Change the numeric output for the legend. Change to the range [0,4,8]
How do I do that?
import seaborn as sns
cmap = sns.light_palette("green", as_cmap=True)
iris = sns.load_dataset("iris")
p=sns.scatterplot("sepal_length", "sepal_width",data=iris
,hue="petal_length"
,palette = cmap
)
p.set(xlabel='Sepal Len', ylabel='Sepal Width')
p.legend(title="Petal Length")
plt.show()