#243 Area chart with white grid

Another example of area chart using the white grid seaborn style. This chart has been found on stack overflow, proposed by mwaskom.


# libraries
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style("whitegrid")

# Color palette
blue, = sns.color_palette("muted", 1)

# Create data
x = np.arange(23)
y = np.random.randint(8, 20, 23)

# Make the plot
fig, ax = plt.subplots()
ax.plot(x, y, color=blue, lw=3)
ax.fill_between(x, 0, y, alpha=.3)
ax.set(xlim=(0, len(x) - 1), ylim=(0, None), xticks=x)

Leave a Reply

Your email address will not be published.