Python 设置堆栈打印线的颜色不起作用
我试图将堆栈图的线条颜色设置为白色,但我研究的解决方案似乎不起作用。还有什么其他选择Python 设置堆栈打印线的颜色不起作用,python,python-2.7,matplotlib,Python,Python 2.7,Matplotlib,我试图将堆栈图的线条颜色设置为白色,但我研究的解决方案似乎不起作用。还有什么其他选择 from matplotlib import pyplot as plt y = [1,3,5] x = [0,1,2] fig, ax = plt.subplots() ax.stackplot(x, y) ax.fill_between(x, y, facecolor='#ededed') plt.show() 那么这个呢: ax.stackplot(x, y, color='b', colors=('r
from matplotlib import pyplot as plt
y = [1,3,5]
x = [0,1,2]
fig, ax = plt.subplots()
ax.stackplot(x, y)
ax.fill_between(x, y, facecolor='#ededed')
plt.show()
那么这个呢:
ax.stackplot(x, y, color='b', colors=('red',))
使用edgecolor(我添加了第二个堆栈以显示白线):
from matplotlib import pyplot as plt
y = [[1,3,5], [3,4,5]]
x = [0,1,2]
fig, ax = plt.subplots()
ax.stackplot(x, y, edgecolor='white')
plt.show()