python plot bins not lining up with axis

Solutions on MaxInterview for python plot bins not lining up with axis by the best coders in the world

showing results for - "python plot bins not lining up with axis"
Ida
18 Oct 2020
1# Basic syntax for left-aligned bins:
2plt.hist(data, bins=range(number)) 
3
4# Basic syntax for center-aligned bins:
5plt.hist(data, bins=np.arange(number)-0.5)