堆栈图线的设置颜色不起作用
Setting color of stack plot line not working
我正在尝试将堆栈图的线条颜色设置为白色,但我研究的解决方案似乎不起作用。还有哪些其他选择?
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()
我正在尝试将堆栈图的线条颜色设置为白色,但我研究的解决方案似乎不起作用。还有哪些其他选择?
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()