File: example2.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 (34 lines) | stat: -rwxr-xr-x 655 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
#!/usr/bin/env python

import sys
sys.path.insert(1,'..')

import biggles
import Numeric, RandomArray

p = biggles.FramedPlot()
p.xrange = 0, 100
p.yrange = 0, 100
p.aspect_ratio = 1

x = Numeric.arange( 0, 100, 5 )
yA = RandomArray.normal( 40, 10, (len(x),) )
yB = x + RandomArray.normal( 0, 5, (len(x),) )

a = biggles.Points( x, yA, type="circle" )
a.label = "a points"

b = biggles.Points( x, yB )
b.label = "b points"
b.style( type="filled circle" )

l = biggles.Slope( 1, type="dotted" )
l.label = "slope"

k = biggles.PlotKey( .1, .9, [a,b,l] )

p.add( l, a, b, k )

#p.write_img( 400, 400, "example2.png" )
#p.write_eps( "example2.eps" )
p.show()