[英]Matplotlib cumulative plot
您可以在此找到解決方案: http : //matplotlib.org/examples/pylab_examples/stackplot_demo.html
您可以使用matplotlib
fill_between
,例如,
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 2, 0.1)
y = 10*np.ones(x.shape[0])
c = ['r', 'b', 'g', 'y', 'k']
fig, ax = plt.subplots()
for i in range(5):
r = np.random.randn(x.shape[0])
yp = np.copy(y)
y = y + np.cumsum(np.abs(r))
ax.fill_between(x, yp, y, color=c[i], alpha=0.5)
plt.show()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.