I am trying to plot histogram.
plt.bar([1,2,3], [4,5,6],color="r",align="center")
I don't wanna plot the zero in the beginning of the axes. This ridiculous way to do it.
plt.yticks(range(len([1,2,3])),["None"]+[1,2,3])
Is there any good way to do that ?
This is similar to this question. There isn't a much less ridiculous way to do what you're trying to do. This snippet, adapted from the linked question,
ax = plt.gca()
xticks = ax.xaxis.get_major_ticks()
xticks[0].label1.set_visible(False)
should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With