
This is because "h" in "hsv" is a circular variable, going from 0 to 360 degrees. The problem with your first example, is that the hsv palette has the same color at its start and at its end.

, ĭf = pd.DataFrame(lst, columns =)Įlif ((afy >= afMin and afy = afMin or afx <= afMax)): Here I put the entire script so that you can replicate it: import pandas as pd Sns.scatterplot(data = df, x="af_x", y="af_y", hue="color", s=40, legend=False) Sns.set_palette(sns.color_palette(colors)) Here the plot:Īnd here's the code: #violet #green #orangeĬolors = But the scatterplot instead of getting colored with the shades I picked, it gets colored with some colors I used in another script some time ago, and there's no way to change them. Now something VERY weird happens: to circumnavigate the problem, I built my own palette ad added it to the seaborn istance.

Sns.scatterplot(data = df, x="af_x", y="af_y", hue="color", palette = "hsv", s=40, legend=False)īut the result is the following: as you can see, one hue does not get colored, as there are only two colors, blue and red. Now, i create a scatterplot using seaborn and a seaborn palette in this way: I want to color the markers based on some conditions for af_x and af_y, but since I don't any column to exploit as a hue, I created my own column "color". I have a simple dataframe with a value "pos" and two other values, "af_min" and "af_max". I am having some trouble with coloring my scatterplot markers.
