Hello Enrico,
On Wed, Oct 27, 2010 at 03:43:32PM +0200, Enrico Avventi wrote:
> hello,
>
> i got stuck finding how i could perform certain customizations of my graphs.
> so far i managed to avoid printing tick labels in the following way:
>
> class nolabel:
> def labels(self,ticks):
> for tick in ticks:
> tick.label = ""
>
> c = pyx.canvas.canvas()
> g = c.insert(pyx.graph.graphxy(width=w, height=h,
> y=pyx.graph.axis.logarithmic(texter=nolabel())))
> g.plot(...)
This works, but the easiest way is to use the "labeldists"parameter
from the parter :
from pyx import *
p = graph.axis.pathaxis(path.line(0,0,10,10),
graph.axis.linear(min=0,max=10,parter=graph.axis.parter.lin(tickdists=[2,1],labeldists=[])))
This creates Ticks at distance 2 (so: 0,2,4,6,8,10), but does NOT add
any labels to it.
>
> i would want to also change the thickness of the box containing the function
> plot
>
> i think painter class would be the place to look at but only tick attributes
> are mentioned.
It also has a parameter "basepathattrs":
p = graph.axis.pathaxis(path.line(0,0,10,10),
graph.axis.linear(min=0, max=10,
parter=graph.axis.parter.lin(tickdists=[2,1],labeldists=[]),
painter=graph.axis.painter.regular(basepathattrs=[style.linewidth.THIck])))
plots a thick line.
HTH,
Axel
