Menu

[r1418]: / trunk / htdocs / examples / barh_demo.py  Maximize  Restore  History

Download this file

21 lines (16 with data), 425 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# make a horizontal bar chart
from pylab import *
x = 3+10*rand(5) # the bar lengths
y = arange(5)+.5 # the bar centers on the y axis
figure(1)
barh(x,y)
yticks(y, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
xlabel('Perfomance')
title('How fast do you want to go today?')
grid(True)
figure(2)
barh(x,y, xerr=rand(5))
yticks(y, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
xlabel('Perfomance')
show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.