Home > Visualization > Main text

Area plot


Tag: plot, visualization

Stacked area for multiple category reference

import numpy as np
import matplotlib.pyplot as plt

x=range(1,6)
y=[ [1,4,6,8,9], [2,2,7,10,12], [2,8,5,10,6] ]
 
plt.stackplot(x,y, labels=['A','B','C'])
plt.legend(loc='upper left')
plt.show()


If you link this blog, please refer to this page, thanks!
Post link:https://tsinghua-gongjing.github.io/posts/areaplot.html

Previous: Lollipop plot