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

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

import biggles
import Numeric, math

x = Numeric.arange( 1*math.pi, 3*math.pi, math.pi/30 )
c = Numeric.cos(x)
s = Numeric.sin(x)

p = biggles.FramedPlot()
p.aspect_ratio = 1
p.frame1.draw_grid = 1
p.frame1.tickdir = 1

p.x1.label = "bottom"
p.x1.subticks = 1

p.y1.label = "left"
p.y1.draw_spine = 0

p.x2.label = "top"
p.x2.range = 10, 1000
p.x2.log = 1

p.y2.label = "right"
p.y2.draw_ticks = 0
p.y2.ticklabels = [ "-1", "-1/2", "0", "1/2", "1" ]

p.add( biggles.Curve(x, c, type='dash') )
p.add( biggles.Curve(x, s) )

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