In matplotlib you can achieve this by setting margins
import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.margins(0.04) data = range(1, 11) ax.plot(data, 'wo') plt.savefig('margins.png')

However, it seems that there is an rc parameter to get this parameter.
Update 4/2013
The ability to add rc param for fields is now in matplotlib master (Thanks @tcaswell). Therefore, it should work with the next version of matplotlib (the current version is 1.2.1).
bmu Nov 21 '12 at 6:57 2012-11-21 06:57
source share