How to set ‘auto’ for upper limit, but keep a fixed lower limit

You can pass just left or right to set_xlim:

plt.gca().set_xlim(left=0)

For the y axis, use bottom or top:

plt.gca().set_ylim(bottom=0)

Important note: “you must use the functions AFTER you have plotted the data. If you don’t do this, it will use the default 0 for left/bottom and 1 for top/right.” – Luc’s answer.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)