I developed a barplot for some data using python.How do you develop labels for the categorical values?
The data represents 0="Female" and 1="Male". The barplot developed shows only 0 and 1 but I want to represent as Female and Male.
Using the following code I got the below output:
sns.barplot(x=df.cp, y=df.chol, hue=df.sex, palette='spring')
plt.xlabel("Chest Pain Type")
plt.ylabel("Serum Cholesterol")
plt.show()

I tried adding this piece of code to the above but the output is not as expected and color differentiation is missing:
plt.legend(title="sex", loc="upper right", labels=["Female", "Male"])

Thank you
dflook like? - m13op22sns.barplot(x="cp", y="chol", hue="sex", data=df). - m13op22