Hello André,

I found a strange behaviour of the axis partitioning, when combining
it with manual ticks and a divisor. The x2-axis (which is
automatically linked to x) has a tick at 10pi instead of a tick at pi.
See the joint example.

It would be great if you could see to it...

Best,
  Michael

#!/usr/bin/env python3
from math import pi
from pyx import *
from pyx.graph import axis
from pyx.graph.axis.tick import tick

myticks = [tick(0, label="0", labelattrs=[text.mathmode, text.halign.left]),
           tick(1, label="\pi", labelattrs=[text.mathmode, text.halign.right])]

g = graph.graphxy(width=10,
    x=axis.linear(min=0, max=pi, manualticks=myticks, divisor=pi,
                  texter=axis.texter.rational(numsuffix="\pi", over=r"{{%s}/{%s}}"),
                  parter=axis.parter.autolinear(variants=[[tick((1, 2)), tick((1, 4))]]), # autolinear produces wrong tick on x2
                  #parter=axis.parter.linear(tickdists=[tick((1, 2)), tick((1, 4))]), # linear does not
                  painter=axis.painter.regular(tickattrs=[style.linewidth.THIck, color.rgb.red]),
                 ),
    y=axis.linear())

# make the ticks on x2 more visible:
g.axes["x2"] = axis.linkedaxis(g.axes["x"], painter=axis.painter.regular(tickattrs=[style.linewidth.THIck, color.rgb.red]))
g.plot(graph.data.function("y(x) = sin(x)"))
g.writePDFfile()

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel

Reply via email to