Guess whether its good practice is a bit of a discussion. It somehow suggest that your plot continues (but you just show a window of it), so if your plot is only defined in this region having an offset would make sense. If it actually continues but you just plot this part, then it's logical to remove it.
The scalable approach is
plt.gca().set_xlim([np.min(x), np.max(x)])