Reputation: 616
I'm trying to figure out how to get the major gridline at y=0
to display. I have major gridlines turned on, I want the box/border turned off and I have tried manually setting the major gridlines but this has not allowed the y=0
line to display.
plt.figure(figsize=(6,3))
plt.ylim(0,1)
plt.legend(loc='best')
#plt.yticks(np.arange(0, 1.2, 0.2))
plt.grid(True, 'major', 'y')
plt.box(on=None)
plt.show()
Upvotes: 0
Views: 144
Reputation: 80289
You could turn clipping off for the grid lines:
plt.gca().yaxis.get_gridlines()[0].set_clip_on(False)
Upvotes: 1