|
From: Andrea R. <ari...@pi...> - 2004-10-18 13:28:00
|
Hi,
I was playing with manual ticks when I've discovered what I think is a
bug (PyX v0.6.3). Here is a minimal script that exhibits this
misbehaviour:
import pyx
p = pyx.path.line(0, 0, 4, 0) # I prepare a straight line
# I start to define my own ticks list so that major ticks are
# interleaved with minor ones.
myTicks = [pyx.graph.axis.tick.tick(0., label = "0", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(0.1, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(0.2, label = "0.2", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(0.3, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(0.4, label = "0.4", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(0.5, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(0.6, label = "0.6", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(0.7, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(0.8, label = "0.8", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(0.9, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(1.0, label = "1", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(1.1, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(1.2, label = "1.2", labelattrs =
[pyx.text.mathmode]),
pyx.graph.axis.tick.tick(1.3, label = "", ticklevel = 1),
pyx.graph.axis.tick.tick(1.4, label = "1.4", labelattrs =
[pyx.text.mathmode]),]
# And now I plot the axis.
c = pyx.canvas.canvas()
c.insert(pyx.graph.axis.pathaxis(p, pyx.graph.axis.lin(min = 0, max =
1.4, manualticks = myTicks)))
c.writeEPSfile("amelia.eps")
Very simple example indeed, but look at the resulting eps file (I
attach to the email what I get) and especially to the 0.5 tick. It
should be a minor tick (as I defined it), but it's major one!
I've no idea about where the bug could be, nevertheless I hope this can
be of any help.
Cheers,
Andrea.
|