1 # contributed by Francisco Borges
4 from pyx
.graph
import graphxy
, data
, axis
5 from pyx
.graph
.axis
import painter
, tick
6 from pyx
.deco
import earrow
10 p
= painter
.regular(basepathattrs
=[earrow
.normal
], titlepos
=0.95,
11 outerticklength
=painter
.ticklength
.normal
,
12 titledist
=-0.3, titledirection
=None) # horizontal text
14 g
= graphxy(width
=10, xaxisat
=0, yaxisat
=0,
15 x
=axis
.linear(title
="$x$", min=-range, max=+range, painter
=p
,
16 # suppress some ticks by overwriting ...
17 manualticks
=[tick
.tick(0, None, None),
18 tick
.tick(range, None, None)]),
19 y
=axis
.linear(title
=r
"$x\sin(x^2)$", painter
=p
,
20 manualticks
=[tick
.tick(0, None, None),
21 tick
.tick(3, None, None)]))
23 g
.plot(data
.function("y(x)=x*sin(x**2)"),
24 # Line style is set before symbol style -> symbols will be draw
26 [graph
.style
.line([style
.linewidth
.Thin
, style
.linestyle
.solid
]),
27 graph
.style
.symbol(graph
.style
.symbol
.circle
, size
=0.1,
28 symbolattrs
=[deco
.filled([color
.rgb
.green
]),
29 deco
.stroked([color
.rgb
.red
])])])
31 # manually typeset "0" near the origin
34 g
.text(x0
- 0.2, y0
- 0.2, "0", [text
.halign
.right
, text
.valign
.top
])
36 g
.writeEPSfile("symbolline")
37 g
.writePDFfile("symbolline")