I have a simple plot executed using matplotlib. My x and y axes start at 0,0 respectively. A matplotlib plot shows 2 zeros corresponding to the 2 axes. I want only one zero (somewhere in the middle of the start point, if possible). How can this be done?
Here's what I used:
import matplotlib.pyplot as plt
plt.plot([1,2,3], [4,5,6])
plt.xlim([0,5])
plt.ylim([0,10])
plt.show()
UPDATE:
I used @nostradamus' solution and it got rid of one of the zeros. I want the zero a little centred if possible.
I used:
plt.gca().xaxis.set_major_locator(MaxNLocator(prune='lower'))
plt.gca().yaxis.get_majorticklabels()[0].set_x(-0.05)
I want the reverse of this. I want the zero on the y axis to move down or the one from x axis left. So tried:
plt.gca().yaxis.set_major_locator(MaxNLocator(prune='lower'))
plt.gca().xaxis.get_majorticklabels()[0].set_x(-0.05)
It doesn't work. I think the bottom and left boundaries for the zeros are set to ensure they don't go beyond the area.

