Hi André, André Wobst venit, vidit, dixit 21.06.2010 22:31: > Michael, > > Sorry, surface is for rectangular grids only. Quoting the manual > "Draws a surface of a rectangular grid. Each rectangle is divided > into 4 triangles."
I guess my problem is that I don't know what a rectangular grid is ;) Using graph.data.points etc. one can pass quite arbitrary point sets to graph.plot, i.e. point sets which are not necessarily "graphs", and with no special distinction for the first few coordinates/columns. graph.function and graph.functionxy generate very special 2D point sets: y is a function of x (the set is a graph), and the x values are ordered and equally spaced. But there is no such thing for generating 3D point sets. I even remember that a suggestion for 3D analogs (graph of a function of 2 variables) was dismissed because the interface was supposed to be more general. graph.style.surface seems to assume at least some ordering of the points, such as left-to-right then back-to-front, and, maybe, rectangularity in the strict sense. In that case there should be a 3D data provider which takes 2 (ordered) lists (x values, y values) and a function argument and generates a data instance suitable for style.surface, or a helper which generates the x-y-grid. I guess in numpy that would be something like "zip(outer(x, ones(...)), outer(ones(...), y)" or similar. > > You can use points and lines for any kind of data, but this might not > at all help you. However, graphxyz might still be useful to you: You > can use it for conversion of 3-dimensional points to two dimensions > (with all the features like easily rotate the coordinate system, > change projectors, etc.). Here's an example: Oh, I do consider graphxyz useful for graphs of functions of 2 variables. And your example shows another use case. Also, being able to plot (style.line) a parametric function of 1 variable on top of a 3D graph is cool, for example plotting selected level lines on top of a surface. [There's no hidden line removal, of course.] It's just that I started experimenting with graphxyz again, thinking about the best ways to do e.g. the following with the current interface, or with numpy/pyx or a future interface: 1) plot f(x,y) on a rectangular domain 2) plot f(x,y) on a non-rectangular domain (say, defined by a z-range for f 3) parametric plot: [x(t,s),y(t,s),z(t,s)] I can do 1) of course, but the interface could be simpler. Using non-uniformly spaced points (still rectangular) works and is useful. I can do 2) of course, but it suffers from "ragged boundaries" because I can only deletes points, not nodes or triangles. [That was my starting point for experimenting with non-rectangular grids: Adding some points at the boundary.] 3) Has been answered completely I'm afraid :| Michael ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
