Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sns.set_theme(style="whitegrid")
- #initializing matplotlib figure
- f, ax= plt.subplots(figsize=(20,10))
- #plotting types
- sns.set_color_codes("pastel")
- sns.barplot(x="Total" ,y="Type",data=cleanFraud,color="b" )
- #plotting fraud
- sns.set_color_codes("muted")
- sns.barplot(x="Total_Fraud", y="Type", data= cleanFraud, color="b" )
- # more information
- ax.set(xlim=(0,2500000), xlabel="Total Number of Fraudulent Transactions Per Total transactions" )
- sns.despine(left=True, bottom=True)
- index=0
- print(len(ax.patches))
- for p in ax.patches:
- # ax.annotate((p.get_height()), (p.get_x()+0.30, p.get_height()+300))
- if index< len(ax.patches)/2:
- ax.annotate((p.get_width()), (p.get_width()+700,p.get_y()))
- else:
- ax.annotate((p.get_width()), (p.get_width(),p.get_y()))
- # print(p.get_width(),"\n")
- index+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement