Reputation: 9213
I am trying to set the line color of a stack plot to white, but the solution I researched seems to not be working. What other options are there?
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()
Upvotes: 4
Views: 4717
Reputation: 988
use edgecolor (I added a second stack to illustrate the white line):
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()
Upvotes: 1