Hi Michael,

Am 09.06.2008 um 10:06 schrieb Michael J Gruber:
> g = graph.graphxyz(size=1.5)
> g.plot(graph.data.functionxy("z(x,y)=x**2+y**2", xmin=-1, xmax=1,
> ymin=-1, ymax=1, points=25), [graph.style.surface()] )

In our current naming scheme it should either read:

g.plot(graph.data.function("z(x,y)=x**2+y**2", xmin=-1, xmax=1,   
ymin=-1, ymax=1, points=25), [graph.style.surface()] )

or

g.plot(graph.data.functionxyz("x**2+y**2", xmin=-1, xmax=1,  ymin=-1,  
ymax=1, points=25), [graph.style.surface()] )

(Sure, one could argue why we don't spell it functionzxy, but we did  
use function xyz as this sounds more natural -- to me.)

But back to the problem. Somehow you use xmin ymin xmax ymax making x  
and y some special names. This is against all rules. PyX would use  
min1, min2, max1, max2. And here you already see that we're back at  
the multi-dimensionality of function which is something new. Somehow  
it's a twodfunction ... which is something different than function.

I'm fine with adding such a code to the PyX core. We basically just  
need a good name. Somehow it's a grid ... or a gridfunction or what???  
Ideas???

> I don't know the underlying grid and hidden surface code. But I  
> noticed
> that it's difficult to produce e.g. a sphere by providing the points  
> in
> an obvious way (using a regular grid "in spherical coordinates").

I thought about this at your first posting too. It's not that easy.

> I really appreciate the possibility to use my own grid, you're  
> right. In
> fact I thought about submitting a simple example which shows how
> powerful PyX is in this regard.

We definitely want that! :-)

> I just thought that having a simple method for "standard" 3D surface
> plots would be nice, at least for the people who use PyX for
> illustrations of text books/homework sheets and the like, where your
> input consists of "advanced functions" like the one above, not numbers
> crunched by your programmes.
>
> Even for 2D plots a non-standard grid can help, and one could argue  
> for
> the removal of the standard graph.data.function(). Maybe one should  
> just
> use numpy or something similar rather than the cumbersome
>
> xs = [ xmin+i*(xmax-xmin)/(N-1) for i in range(N) ]
> ps = [ [x,f(x)] for x in xs ]
>
> and similar for 3D.


I think there is plenty of room to make some fancy data providers for  
PyX (and I want function to become much more advanced in that  
respect), but at the same time it's absolutely appreciated to make  
clever uses of PyX + numpy or whatever else. It would not even render  
your example "exotic" in the respect that I would reject it for the  
examples page. Indeed it's the other way around: I would be happy to  
have one (basic) and some advanced examples in that respect. No  
problem, really!


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/


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel

Reply via email to