I'm trying to do a basic line graph here, but I can't seem to figure out how to adjust my x axis.
from pylab import * plot ( range(0,10),[9,4,5,2,3,5,7,12,2,3],'.-',label='sample1' ) plot ( range(0,10),[12,5,33,2,4,5,3,3,22,10],'o-',label='sample2' ) xlabel('x axis') ylabel('y axis') title('my sample graphs') legend(('sample1','sample2')) savefig("sampleg.png",dpi=(640/8)) show()
And here is the error I get when I try adjusting my range.
File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 228, in _xy_from_xy raise ValueError("x and y must have same first dimension") ValueError: x and y must have same first dimension
I want my range to be a list of strings: ["12/1/2007","12/1/2008", "12/1/2009","12/1/2010"