I think you can use the xticks function to set string labels:
nums = arange(2003, 2010) xticks(nums, (str(n) for n in nums))
EDIT: This is the best way:
gca().xaxis.set_major_formatter(FormatStrFormatter('%d'))
or something like that. (In older versions of Matplotlib, the method was called setMajorFormatter .)
David z
source share