import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy import stats
import Pythonic_files as pf
import pandas as pd
%matplotlib inline
%config InlineBackend.figure_format='retina'
x,y =pf.elipse_noise(10000,17,(20,10),(100,200))
plt.figure(figsize=(13,6))
plt.scatter(x,y, alpha=0.051)
dataX = pd.DataFrame([x,y], index=None)
dataX=dataX.T
dataX.columns=['x','y']
dataX.head()
plt.figure(figsize=(13,6))
sns.scatterplot(x='x',y='y',data=dataX, alpha = 0.52)
dataX.describe()
plt.figure(figsize=(13,6))
sns.kdeplot(x='x',y='y',data=dataX, n_levels=50, shade=True, cmap='RdBu_r',cbar=True,thresh = 0)
plt.show()
plt.figure(figsize=(13,6))
sns.jointplot(x='x',y='y',data=dataX, kind='hex')
plt.show()
sns.pairplot(data=dataX)
plt.show()
x,y =pf.elipse_noise(10000,17,(20,10),(100,200))
plt.figure(figsize=(13,6))
plt.scatter(x,y, alpha=0.051)
sns.displot(dataX.y, kind='kde')
sample_size = 500
#np.random.choice(x,sample_size,replace=False)
samples = np.random.randint(0,len(x),sample_size)
plt.figure(figsize=(13,6))
plt.scatter(x,y, alpha=0.051)
plt.plot(x[samples],y[samples], 'x', c='orange')
plt.show()
sns.distplot(x)
sns.distplot(x[samples])
plt.figure(figsize=(26,12))
plt.subplot(2,2,1)
plt.plot(x,y,'.',alpha=0.15)
plt.xlim(95,105)
plt.ylim(195,205)
plt.subplot(2,2,2)
plt.plot(x[samples],y[samples],'x',alpha=0.55, c='orange')
plt.xlim(95,105)
plt.ylim(195,205)
plt.subplot(2,2,3)
plt.hist(x,bins=20)
plt.xlim(95,105)
plt.subplot(2,2,4)
plt.hist(x[samples],bins=20)
plt.xlim(95,105)
plt.show()
print(np.mean(x),np.mean(x[samples]))