3.3 Area Chart
1. Area Chart and Highlight Line
x = range(1,13)
y1 = [4,6,8,4,5,3,7,4,1,5,6,8]
y2 = [9,5,4,8,5,6,2,4,1,3,7,7]
# customize setting
plt.style.use('seaborn-whitegrid')
plt.rcParams.update({'font.size': 18})fig,(ax1,ax2) = plt.subplots(1,2,sharey=True, figsize= (16,6))
ax1.fill_between(x,y1,color= 'salmon',alpha = 0.4)
ax1.set_title('Simple Area Chart') # set title of ax1
ax2.fill_between(x,y2,color= 'skyblue',alpha = 0.4) # create area chart
ax2.plot(x, y2, color="blue",linewidth = 2) # create highlight line
ax2.set_title('Area + Hightlight Line')

Example 2

2. Stacked Area Chart

Last updated