Dear Brendon,

sorry for the late response. I was just too busy with work to come back to your 
question. And first of all thank you to provide a rather minimal example.

Am 26.04.2011 um 22:40 schrieb Brendon Higgins:
> Brendon Higgins wrote (April 20, 2011):
>> When I set manual ticks (to remove those at the origin, for
>> example) I get a ZeroDivisionErro in the rater. It seems that there is no
>> weight. What I struggle to understand is why it works fine for ordinary
>> PyX graphs, but not my minkowski class.
> 
> After much gnashing of teeth, I have eliminated my own code as the cause. I 
> believe this is a bug in PyX. Example trigger code can be constructed using 
> the ordinary data.function source with particular (and not unreasonable, 
> especially in the case of direct relativistic calculations) parameters, as 
> follows:
> 
> from pyx import *
> 
> g = graph.graphxy(width=8,
>   x=graph.axis.linear(title="$x$", min=-120000, max=120000,
>       manualticks=[graph.axis.tick.tick(0, None, None)]),
>   y=graph.axis.linear(title="$y$", min=-0.0002, max=0.0002,
>       manualticks=[graph.axis.tick.tick(0, None, None)]))
> 
> g.plot(graph.data.function("y(x)=x/6e8", min=0, max=0.0001))
> g.writePDFfile("test")


The parameter ranges should indeed not harm at all. Never. What happens here 
might be related to the settings, though, but it can could be triggered 
elsewhere as well. The problem is, that the ticks created by the automatic 
parter in combination with the manualtick you set result in a list of only a 
single tick with labellevel and ticklevel being None. The rater breaks for 
that. While we could create a special case in the rating and return None here, 
I favor to remove those ticks completely. I decided to not change it in the 
mergeticklists helper function, but filter it explicitly in the axis code. See 
changeset 3051 (and 3052 due to a broken checkin without any testing – sorry).

You can also run your code on earlier unfixed versions of PyX by not setting 
both, the ticklevel and the labellevel to be None. For example 
graph.axis.tick.tick(0, 0, None) (note the second zero compared to your None) 
works on unpatched versions of PyX.

Best


André

-- 
by  _ _      _    Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
   / \ \    / )   [email protected], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to