# 散点图矩阵
import seaborn as sns
import pandas as pd
df = sns.load_dataset("iris")
sns.pairplot(df, hue="species")
# 带有误差边界的时序图
sns.set(style="darkgrid")
fmri = sns.load_dataset("fmri")
sns.lineplot(x="timepoint", y="signal", hue="region", style="event", data=fmri)
# 带有观测值的水平箱型图
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="ticks")
f, ax = plt.subplots(figsize=(7, 6))
ax.set_xscale("log")
planets = sns.load_dataset("planets")
sns.boxplot(x="distance", y="method", data=planets, whis="range", palette="vlag")
sns.swarmplot(x="distance", y="method", data=planets, size=2, color=".3", linewidth=0)
ax.xaxis.grid(True)
ax.set(ylabel="")
sns.despine(trim=True, left=True)
# 热力图
import seaborn as sns
flights_long = sns.load_dataset("flights")
flights = flights_long.pivot("month", "year", "passengers")
sns.heatmap(flights, annot=True, fmt="d", linewidths=0.5)