6. Area Plot
[1]:
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
plt.style.use('ggplot')
np.random.seed(37)
6.1. Basic
[2]:
mus = [100, 105, 90, 20]
sigmas = [1.0, 2.0, 3.0, 5.0]
df = pd.DataFrame({f'x{i}': sigma * np.random.randn(1000) + mu
for i, (mu, sigma) in enumerate(zip(mus, sigmas))})
fig, ax = plt.subplots(figsize=(10, 5))
_ = df.plot(kind='area', ax=ax)
_ = ax.set_title('Basic area plot')
_ = ax.legend(bbox_to_anchor=(1, 1), loc='upper left')