<jupyter_start><jupyter_text>Visualization with Seaborn<jupyter_code>#Seaborn Versus Matplotlib
import matplotlib.pyplot as plt
plt.style.use('classic')
%matplotlib inline
import numpy as np
import pandas as pd
#in matplotlist
rng = np.random.RandomState(0)
x = np.linspace(0, 10, 500)
y = np.cumsum(rng.randn(500, 6),0)

plt.plot(x, y)
plt.legend('ABCDEF', ncol= 2, loc = 'upper center');
#seaborn
import seaborn as sns
sns.set()

plt.plot(x, y)
plt.legend('ABCDEF',ncol=2, loc = 'upper center');
#Exploring Seaborn Plots
#Histograms, KDE, and densities

data = np.random.multivariate_normal([0, 0], [[5, 2], [2, 2]], size = 2000)
data = pd.DataFrame(data, columns=['x', 'y'])

for col in 'xy':
  plt.hist(data[col], density=True, alpha = 0.5)
#estimate of the distribution
for col in 'xy':
  sns.kdeplot(data[col], shade=True)
#distplot
sns.displot(data['x'])
sns.displot(data['y']);

with sns.axes_style('white'):
  sns.jointplot("x", "y", data, kind='hex')
#Pair plots
iris = sns.load_dataset('iris')
iris.head()
#multidimensional relationships among the samples
sns.pairplot(iris, hue ='species', size = 2.5);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16958041958041958, 'fraction_numerical': 0.024475524475524476, 'mean_word_length': 6.067901234567901, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '352363', 'license': 'MIT', 'n_tokens_mistral': 494, 'n_tokens_neox': 455, 'n_words': 113, 'path': 'Matplotlib_5.ipynb', 'repo_name': 'KazumaShachou/DataScience', 'size': '1144'}