This is the code:
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
plt.figure(figsize=(15,8))
ax=sns.histplot(x='type',data=df[df.isFraud == 1],stat='percent',multiple='dodge',common_norm=False,bins=25)
ax=sns.histplot(x='type',data=df[df.isFraud == 0],stat='percent',multiple='dodge',common_norm=False,bins=25)
ax.set_ylabel('Percentage in Each Type')
ax.set_xlabel('Transaction Amount')
plt.legend(labels=['Fraud', 'Not Fraud'])
plt.show()
This is the output (https://i.stack.imgur.com/2et9z.jpg)
I need different colours for 'fraud' and 'not fraud'
I tried adding the colour and palette parameter according to the documentation but it's not working out. I think its getting overridden by some other thing but i am not sure what it is.
I am working on a dataframe from kaggle. I want to show the correlation between the column [isFraud 0 or 1] and the types of transactions. I have edited the post and added a sample of the dataframe.