from pylab import *
plot([1,2,3,4])
xlabel('x axis')
xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally') )
show()
Monday, 14 January 2008
python plot using specific xticks
Subscribe to:
Post Comments (Atom)
Supporting MAC is my way to support Linux
from pylab import *
plot([1,2,3,4])
xlabel('x axis')
xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally') )
show()
2 comments:
"arange" returns ARRAY RANGE.
It comes with numpy, of course exists in pylab as well.
For example:
>>> a=range(1,5)
>>> a
[1, 2, 3, 4]
>>> import pylab
>>> b=pylab.arange(1,5)
>>> print b
[1 2 3 4]
>>> b
array([1, 2, 3, 4])
Post a Comment