1
## Automatically adapted for scipy Oct 31, 2005 by
3
# Copyright (c) 1996, 1997, The Regents of the University of California.
4
# All rights reserved. See Legal.htm for full text and disclaimer.
7
from numpy.core.umath import *
8
GraphicsError = "GraphicsError"
11
graphics = os.environ["PYGRAPH"]
15
if graphics [0:3] == "Nar" :
17
elif graphics == "Gist" :
20
raise GraphicsError , \
21
graphics + " is an unknown graphics package. Check PYGRAPH " + \
22
"environment variable."
24
from curve import Curve
27
i = raw_input ("Type in any string to continue; ^C to return to prompt. ")
30
if graphics [0:3] == "Nar" :
31
print "This is a test of the Python interface to the Limeil Lab graphics"
32
print "package, Narcisse. You need Narcisse to be running. Fire it up by"
33
print "typing /dist/basis/Narcisse/bin/Narcisse."
34
elif graphics == "Gist" :
35
print "This is a test of the Python interface to the Gist graphics package."
45
c1 = Curve ( y = arange (1, kmax+1, dtype = Float) , color = "yellow" )
46
g2 = Graph2d ( c1 , titles = ["Bottom of the Barrel", "Top Dog",
47
"Leftist", "Reaganist"] )
50
c2 = Curve ( y = sqrt (arange (1, kmax+1, dtype = Float)**3) ,
55
c1.set (marks = 1, marker = "A")
56
c2.set (marks = 1, marker = "B")
65
c1.set (type = "dash")
66
c2.set (type = "dashdot")
72
mycolor= ["red", "blue", "yellow", "green", "orange", "purple"]
73
markers= ["+", "*", "o", "x", "."]
75
for i in range (len (markers)) :
77
y = exp (array (multiply ((1.0+(i+1)/10.), log (range (1, kmax))))) ,
78
color = mycolor [i] , marks = 1, marker = markers [i] ,
81
g2.new ( c5 , text="Line style and grid test" , text_color="black" ,
82
text_pos = array ( [.2, .8]) , text_size = 60 ,
83
titles = "Figure 1", old_plotter = 1)
86
g2.quick_plot ( grid_type = "wide" )
88
part1 = abs (array ( [-5, -4, -3, -2, -1, .0000000001] ) )
89
c1.new ( y = part1, x = arange (-5, 1, dtype = Float) ,
90
type="line" , color = "blue" )
91
part2 = array ( [.0000000001, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
92
c2.new ( y = part2 , x = arange (0, 11, dtype = Float) ,
93
type = "line" , color = "blue" )
94
g2.new ( [c1, c2] , text = " " , axis_scales = "linlog" , titles = " " ,
95
axis_limits = array ( [[-6., 10.], [1.e-6, 10.]]), old_plotter = 1)
98
c1.new ( y = array (exp (multiply (log (10.0), range (-50, 1)))) ,
99
x = arange (1, 52, dtype = Float) )
100
g2.new ( c1 , axis_scales = "loglog" ,
101
axis_limits = array ( [[1., 100.], [1.e-8, 1.]]), old_plotter = 1)
104
c1.new ( y = array ( [1.e-48, 1.e-21, 0., 0., 0.]) )
105
g2.new ( c1 , axis_scales = "linlin" ,
106
axis_limits = array ( [[0., 0.], [0., 0.]]), old_plotter = 1)