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
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to