plt.margins
can be used to adjust the automatic padding around your data as below.
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(10)
y = np.power(x, 3)
plt.plot(x, y, 'ro')
# Create a 5% (0.05) and 10% (0.1) padding in the
# x and y directions respectively.
plt.margins(0.05, 0.1)
plt.show()
If you had a minimum value of 500
and wanted the border to be around 400
then you could choose an x-margin percentage of 0.2
as in plt.margins(0.2, 0.2)
.