From: Armin Straub <linux@ar...>  20050913 09:08:47

Hallo Andr=E9, > > I fear that I don't really understand what symmetry of x and y means > > here. > > You may not have noticed (?!), that you can also do a > data.function("x(y)=3D...", ...) ... it works equally well. There's just > noting special regarding the x axis and/or x direction compared to the > y direction. Ok, I think, I'm a bit nearer to understanding the issue. Nice for plotting= =20 inverse functions by the way. Once more I have to see that I'm very new to= =20 PyX. There's so much... :) > I kindly object: your function and your paramfunction fix the order > and the name of the axes involved. In that sense they're quite a > restriction. They're a common usecase and thus they are certainly very > helpful. > [...] > > Nonetheless if this contradicts the concept of symmetry, I think it cou= ld > > be added to the PyX core as functionxy() and paramfunctionxy() but still > > be used as function() and paramfunction() by simplydraw alternatively. > > That's fine, but you may spend some time whether you really want to > introduce such a different meaning. If you really want to do so I'll > not complain. You're free to do so, but I ask you to at least spend a > few seconds before doing you final decision ... ;) I'm thinking about it... If I now understand the problem correctly, the=20 current implementation is bad mainly because =2D it fixes the order =2D and the name of the axes involved. I have solved (at least I hope so) the issue of fixed order using the=20 following code snippet if expression.func_code.co_varnames =3D=3D ('y',): string =3D "x(y)=3Dexpression(y)" else: string =3D "y(x)=3Dexpression(x)" which should yield some more symmetry in the sense that it does matter whet= her=20 a function is defined as f =3D lambda x: sin(x) versus f =3D lambda y: sin(y). This issue does not really appear for paramfunction since all you have to d= o=20 for swapped axes is to return the values (x,y) swapped. So there is at leas= t=20 from a functional point of view little to gain (although I might be wrong=20 here...). Just a note to the named axes. If this would be wanted one could take the=20 function name into account (not useful for lambda style functions though) t= o=20 allow for some settings, but I can't think of a really useful and obvious w= ay=20 (and that's what it should be in my opinion). Thanks for pointing me to this issue! Cheers =2D=20 Armin Straub 