From: Andre Wobst <wobsta@us...>  20060220 06:35:07

Hi, On 19.02.06, Arnd Baecker wrote: > I have a presumably very simple question, > but cannot see the solution: > How can one get get ticks pointing outward on the y2 axis? Indeed, this is not easy to find out. But the solution is simple: You can set a linkpainter for an axis. Whenever a graph creates a linked axis (automatically), it creates a linked axis using this linked painter. So: > ######################################## > import pyx > > xpaint = pyx.graph.axis.painter.regular(innerticklength=0, > outerticklength=pyx.graph.axis.painter.ticklength.Long) > ypaint = pyx.graph.axis.painter.regular(innerticklength=0, > outerticklength=pyx.graph.axis.painter.ticklength.Long) > y2paint = pyx.graph.axis.painter.regular(innerticklength=0, y2paint = pyx.graph.axis.painter.linked(innerticklength=0, # note that the linked painter is to be prefered, since it already # skips the labels and the axis title > outerticklength=pyx.graph.axis.painter.ticklength.Long) > > g = pyx.graph.graphxy(width=10, > x=pyx.graph.axis.linear(min=0, max=5, painter=xpaint), > y=pyx.graph.axis.linear(painter=ypaint), y=pyx.graph.axis.linear(painter=ypaint,linkpainter=y2paint), > # Q: how to get ticks pointing outward here? > #y2=pyx.graph.axis.linear(painter=y2paint) > ) > > g.plot(pyx.graph.data.function("y(x)=sin(x)")) > g.writeEPSfile("test_painter.eps") > ######################################## will do. HTH, André  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ 