Menu

[r472]: / trunk / htdocs / examples / log_bar.py  Maximize  Restore  History

Download this file

26 lines (17 with data), 487 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
from matplotlib import matlab
data = ((3,1000), (10,3), (100,30), (500, 800), (50,1))
matlab.xlabel("FOO")
matlab.ylabel("FOO")
matlab.title("Testing")
matlab.gca().set_yscale('log')
dim = len(data[0])
w = 0.75
dimw = w / dim
x = matlab.arange(len(data))
for i in range(len(data[0])) :
y = [d[i] for d in data]
b = matlab.bar(x + i * dimw, y, dimw, bottom=0.001)
matlab.gca().set_xticks(x + w / 2)
matlab.gca().set_ylim( (0.001,1000))
matlab.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.