## Re: [PyX-user] outward pointing ticks on x2

 Re: [PyX-user] outward pointing ticks on x2 From: Andre Wobst - 2006-02-20 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/ ```

 [PyX-user] outward pointing ticks on x2 From: Arnd Baecker - 2006-02-19 21:32:59 ```Hi, I have a presumably very simple question, but cannot see the solution: How can one get get ticks pointing outward on the y2 axis? The following does not work: ######################################## 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, 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), # 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") ######################################## Uncommenting the line #y2=pyx.graph.axis.linear(painter=y2paint) gives raise RuntimeError("incomplete axis range%s" % errorname) RuntimeError: incomplete axis range for axis y2 Can one somehow get a couple range for y2, but specify a different painter? Usually the plan to post a question leads to the answer, but this time it did not work...;-) Many thanks, Arnd ```
 Re: [PyX-user] outward pointing ticks on x2 From: Andre Wobst - 2006-02-20 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/ ```