Issue
I'm trying to change the colour of the '0's
in my plot to red. I could change the colour of the legend but this isn't reflecting to that dots in the scatter plot. How do I fix this?
Solution
As the data is not available above, I am assuming that over_50['target']
has only two values - 0 or 1. In that case, you should be using palette
to assign colors. legend_handles
will update the colors and not the graph.
I am using a sample code to show this....
import seaborn as sns
tips = sns.load_dataset("tips")
sns.scatterplot(data=tips, x="total_bill", y="tip", hue="time", palette = ['r', 'g']) #Red and Green
Answered By - Redox
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.