Jorge Hernandez
Jorge Hernandez

Reputation: 59

How to correct shifted x-axis?

enter image description hereThe x-axis is shifted to the right and I cant figure out why nor how to fix it?

plt.hist(df['# Payments Made'][my_vals],bins = 'auto')

The 0 on the x-axis should line up with the 0 on the y-axis.

Upvotes: 0

Views: 70

Answers (2)

cookiedough
cookiedough

Reputation: 3832

Try limiting your x-axis to 0 and above:

plt.xlim(left=0)

Upvotes: 1

Parmandeep Chaddha
Parmandeep Chaddha

Reputation: 484

Something like this should work:

plt.xlim(0,) 

Upvotes: 0

Related Questions