#histo
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
mart = pd.read_excel(r"C:\Users\Lenovo Y520\Desktop\visual analytics\Visan56\
visan6\supermarket_sales.xlsx")
mart.head()
plt.figure(figsize=(15,5))
#to plot on x-axis or y-axis
#sns.histplot(data=mart, x='Total')
#sns.histplot(data=mart, y='Total')
# change bin width
#sns.histplot(data=mart, x='Total',binwidth=50)
#sns.histplot(data=mart, x='Total',binwidth=150)
#change number of bins and intervals
#sns.histplot(data=mart, x='Total',bins=30)
#sns.histplot(data=mart, x='Total',bins=np.arange(0,1100,50))
#plt.xticks(np.arange(0,1100,50))
# combine with KDE
#sns.histplot(data=mart, x='Total',kde=True)
# use categorical variable in Hue and Stack it using multiple arguments
#sns.histplot(data=mart, x='Total',hue='Payment')
# for stack
#sns.histplot(data=mart, x='Total',hue='Payment', multiple='stack')
# make step/poly plot using element arguementand change the fill
#sns.histplot(data=mart, x='Total',element='step')
#sns.histplot(data=mart, x='Total',element='step', fill='False')
#sns.histplot(data=mart, x='Total',element='poly')
#sns.histplot(data=mart, x='Total', hue='Payment', element='poly')
#Use categorical variable
#sns.histplot(data=mart, x='Payment')
#sns.histplot(data=mart, x='Payment', shrink=0.75)
#sns.histplot(data=mart, x='Total',stat="")
# stat ==> count, density, probability, frequency
#sns.histplot(data=mart, x='Total',stat='probability')
# Bivariate Histogram
#sns.histplot(data=mart, x='Total',y='gross income')