File: example-matlab.py

package info (click to toggle)
python-biggles 1.6.4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 628 kB
  • ctags: 789
  • sloc: python: 3,728; ansic: 1,103; makefile: 85; pascal: 42
file content (55 lines) | stat: -rwxr-xr-x 705 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python

import sys
sys.path.insert(1,'..')
sys.ps1 = None

import Numeric
from biggles.matlab import *

def press_return():
	print "[press return]"
	sys.stdin.readline()

x = Numeric.arrayrange(-10,10);
y = x**2;
e = y/4

subplot(2,3,1)
plot(list(x), list(y), 'ko-')

subplot(2,3,2)
plot(x, y, 'ro')

subplot(2,3,3)
plot(x, y, 'go')

subplot(2,3,4)
plot(x, y, 'b-')

subplot(2,3,5)
plot([0, 1], [0, 1], 'o')

drawnow(width=500, height=200)
press_return()

drawnow()
press_return()
clf()

plot(x, y, '.')
drawnow()
press_return()

clf()
plot(x, y, 'r*-')
hold_on()
plot(x, -y, 'bv-')
errorbar(x, y/2, e, 'ko-')
title('foo')
xlabel('xbar')
ylabel('ybar')
hold_off()
drawnow()

press_return()