Re: [PyX-user] Reciprocal Scale?

 Re: [PyX-user] Reciprocal Scale? From: Diederik Huys - 2006-05-01 14:57:39 ```You are a god! I've been tampering and sneaking around, and I've come to this now: ------------------------ import math from pyx import * ticklist = [] ll=1400 ul=1700 m=(1700-1400)/3 n=ll while n<=ul: ticklist.append(graph.axis.tick.tick((1.0e7,n),label=1.0e7/n)) n+=m print n g=graph.graphxy(width=8, key=graph.key.key(), x=graph.axis.linear(title="Golflengte (nm)"), y=graph.axis.linear(title="Counts (cps)"), y2=graph.axis.lin(min=1,max=1000), y3=graph.axis.log(min=1,max=1000), x2=graph.axis.linear(title="Golfgetal", min=1.0e7/ll, max=1.0e7/ul, parter=None, manualticks=ticklist, texter=graph.axis.texter.decimal(equalprecision=2))) g.plot(graph.data.file("GLYMO_Er_1.txt", x=1, y=2,title="Test"), styles=[graph.style.line([color.rgb.red, style.linestyle.solid, style.linewidth.thick])]) g.writePDFfile("graph") -------------- The only thing I need to do, is get the precision down (less decimals: 2 is good). As you can see, I tried 'equalprecision' but that didn't work... Also it would be nice if I could scale down the font a bit, and read the limits myself from the input file... but that's less important :) -D- On Monday 01 May 2006 15:45, Alan G Isaac wrote: > On Mon, 1 May 2006, Diederik Huys apparently wrote: > > BTW I already have multiple axes, I just don't know how to > > "repartition" one of them (by hand, as I understand now > > The 'ticks' class allows you to make whatever ticks you > want: > http://pyx.sourceforge.net/manual/module-graph.axis.tick.html > You could make a list of ticks (untested): > ticklist = [] > for n in range(2,6): > ticklist.append(graph.axis.tick.tick((1,n),label="1/"+str(n))) > to get labelled ticks of 1/2, 1/3, 1/4, 1/5. > You can then provide this list as manualticks to your axis: > http://pyx.sourceforge.net/manual/module-graph.axis.axis.html > (Set the parter to None, I think, for your purposes.) > > hth, > Alan Isaac > > > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > PyX-user mailing list > PyX-user@... > https://lists.sourceforge.net/lists/listinfo/pyx-user ```