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

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

import biggles
import math, Numeric 

x = Numeric.arange( 0, 2*math.pi, math.pi/20 )
s = Numeric.sin(x)
c = Numeric.cos(x)

inset = biggles.FramedPlot()
inset.title = "inset"
inset.frame.draw_ticks = 0

inset.add( biggles.Curve(x, s, type="dashed") )

p = biggles.FramedPlot()
p.aspect_ratio = 1.
p.frame.tickdir = +1
p.frame.draw_spine = 0

p.add( biggles.SymmetricErrorBarsY(x, s, [0.2]*len(x)) )
p.add( biggles.Points(x, s, color="red") )
p.add( biggles.Inset((.6,.6), (.95,.95), inset) )

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