Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe288f4

Browse files
committed
added a couple of new examples
svn path=/trunk/matplotlib/; revision=308
1 parent 6d13100 commit fe288f4

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

examples/log_bar.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from matplotlib import matlab
2+
3+
data = ((3,1000), (10,3), (100,30), (500, 800), (50,1))
4+
5+
matlab.xlabel("FOO")
6+
matlab.ylabel("FOO")
7+
matlab.title("Testing")
8+
matlab.gca().set_yscale('log')
9+
10+
dim = len(data[0])
11+
w = 0.75
12+
dimw = w / dim
13+
14+
x = matlab.arange(len(data))
15+
for i in range(len(data[0])) :
16+
y = [d[i] for d in data]
17+
b = matlab.bar(x + i * dimw, y, dimw, bottom=0.001)
18+
matlab.gca().set_xticks(x + w / 2)
19+
matlab.gca().set_ylim( (0.001,1000))
20+
21+
matlab.show()
22+
23+

examples/pcolor_small.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from matplotlib.matlab import *
2+
3+
Z = rand(6,6)
4+
5+
c = pcolor(Z)
6+
c.set_linewidth(4)
7+
show()

0 commit comments

Comments
 (0)