'How to make an overlay grid in matplotlib
I am trying to make a bar graph using matplotlib. How can I get the vertical graph bars to display over the horizontal grey lines, instead of underneath them?
EG: I want it to look like this:

This is what I have now:

My code:
fig = plt.figure(figsize=(6,7))
ax = fig.add_subplot()
plt.title('Survived')
ax.set_xlabel('Survived')
ax.set_ylabel('count')
plt.xticks(np.arange(0,2))
ax.bar(0,a)
ax.bar(1,b)
ax.grid(axis = 'y')
plt.show()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
