how to range the x axis in python code example Example 1: plot bounds python plt.xlim([25, 50]) Example 2: plot bounds python ax.set_ylim([-1, 0])