## Re: [PyX-user] Integer axis in graphs

 Re: [PyX-user] Integer axis in graphs From: James McDermott - 2007-09-25 11:18:49 ```Hi Axel, > In my actual problem, depending on the size of the graph and > the size of the fonts, i get sometimes > 0,5,10,15,20 (which is exactly what I want) > and sometimes > 0,2.5,5,7.5,10,12.5,15,17.5,20. the "tickdists" argument to the partitioner is what you want. Have a look at this program: if you remove the parts about p and xaxis, you should see the non-integer ticks appearing. --- #!/usr/bin/env python from pyx import * d = [[0, 1], [3, 4], [2, 6], [5, 2], [6, 3]] p = graph.axis.parter.linear(tickdists=[1]) xaxis = graph.axis.linear(parter=p) g = graph.graphxy(width=4.5, x=xaxis) g.plot(graph.data.list(d, x=1, y=2)) g.writeEPSfile("test") --- James -- James McDermott PhD candidate in Music Technology CSG026, Dept. Computer Science and Information Systems, University of Limerick, Ireland. http://www.skynet.ie/~jmmcd ```

 [PyX-user] Integer axis in graphs From: Axel Freyn - 2007-09-25 08:53:00 ```Hello, I have a question regarding the axis of a graph: sometimes it happens, that e.g. only integer-values are meaningfull. Is there an easy way, how I could ask the partitioner only to use Integers? In my actual problem, depending on the size of the graph and the size of the fonts, i get sometimes 0,5,10,15,20 (which is exactly what I want) and sometimes 0,2.5,5,7.5,10,12.5,15,17.5,20. The only solution I found myself is to add some fixed values to the list of manual ticks - this also influences the values used by graph.axes.linear. Is there a more general and flexible solution? Thanks, Axel -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kanns mit allen: http://www.gmx.net/de/go/multimessenger ```
 Re: [PyX-user] Integer axis in graphs From: James McDermott - 2007-09-25 11:18:49 ```Hi Axel, > In my actual problem, depending on the size of the graph and > the size of the fonts, i get sometimes > 0,5,10,15,20 (which is exactly what I want) > and sometimes > 0,2.5,5,7.5,10,12.5,15,17.5,20. the "tickdists" argument to the partitioner is what you want. Have a look at this program: if you remove the parts about p and xaxis, you should see the non-integer ticks appearing. --- #!/usr/bin/env python from pyx import * d = [[0, 1], [3, 4], [2, 6], [5, 2], [6, 3]] p = graph.axis.parter.linear(tickdists=[1]) xaxis = graph.axis.linear(parter=p) g = graph.graphxy(width=4.5, x=xaxis) g.plot(graph.data.list(d, x=1, y=2)) g.writeEPSfile("test") --- James -- James McDermott PhD candidate in Music Technology CSG026, Dept. Computer Science and Information Systems, University of Limerick, Ireland. http://www.skynet.ie/~jmmcd ```