<jupyter_start><jupyter_text>Seaborn examples, taken from https://jakevdp.github.io/PythonDataScienceHandbook/04.14-visualization-with-seaborn.html<jupyter_code>import numpy as np
import pandas as pd
import seaborn as sns
# Turning on notebook plots -- just for use in jupyter notebooks.
import matplotlib
matplotlib.use('nbagg')
import matplotlib.pyplot as plt
sns.set()
data = np.random.multivariate_normal([0, 0], [[5, 2], [2, 2]], size=2000)
data = pd.DataFrame(data, columns=['x', 'y'])

fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(9, 4))
for col in 'xy':
    plt.hist(data[col], density=True, alpha=0.5)
fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(9, 4))
for col in 'xy':
    sns.kdeplot(data[col], shade=True)
#fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(9, 4))
with sns.axes_style('white'):
    sns.jointplot("x", "y", data, kind='hex')
iris = sns.load_dataset("iris")
iris.head()
sns.pairplot(iris, hue='species', height=2.5);
tips = sns.load_dataset('tips')
tips.head()
tips['tip_pct'] = 100 * tips['tip'] / tips['total_bill']

grid = sns.FacetGrid(tips, row="sex", col="time", margin_titles=True)
grid.map(plt.hist, "tip_pct", bins=np.linspace(0, 40, 15));
with sns.axes_style(style='ticks'):
    g = sns.factorplot("day", "total_bill", "sex", data=tips, kind="box")
    g.set_axis_labels("Day", "Total Bill");
sns.jointplot("total_bill", "tip", data=tips, kind='reg');
url = 'https://raw.githubusercontent.com/jakevdp/marathon-data/master/marathon-data.csv'
data = pd.read_csv(url)
data.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1892238614496472, 'fraction_numerical': 0.024374599101988453, 'mean_word_length': 6.090909090909091, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '355073', 'license': 'MIT', 'n_tokens_mistral': 665, 'n_tokens_neox': 627, 'n_words': 126, 'path': 'Visualization with Seaborn.ipynb', 'repo_name': 'Umberto1988/PythonCourse', 'size': '1559'}