1# Basic syntax:
2plt.ylim(min,max)
3plt.xlim(min,max)
4
5# Example usage:
6import matplotlib.pyplot as plt
7plt.plot(range(5))
8plt.xlim(-5, 5)
9plt.ylim(-5, 5)
10
11# Note, this approach is more versatile than using range=[min,max] which
12# only works in some plots, e.g. plt.hist(range(5), range=[-5,5])