I'm getting somewhat frustrated with the graphxyz interface (or my
understanding thereof).
For good measure, I'm trying to plot a sphere. Now, no matter what I do,
there seems to be some clipping/whatever going on which deletes points
from my supplied list of points.
The code below works for simple expressions like "p, sin(t), sin(t)" but
not for the one below nor for the one commented out (sphere). I tried
setting the axes ranges so that nothing should get clipped/removed. Why
are nodes being deleted? (Tested with 0.10 as well as trunk.)
Hoping for help...
Michael
from pyx import *
from math import sin, cos, pi
N = 10
g = graph.graphxyz(size=4, x=graph.axis.linear(min=-1,max=1),
y=graph.axis.linear(min=-1,max=1),z=graph.axis.linear(min=-1,max=1))
ps = [ 2*pi*i/N for i in range(N+1) ]
ts = [ pi*i/N for i in range(N+1) ]
#xyz = [ [cos(t)*cos(p), cos(t)*sin(p), sin(t)] for t in ts for p in ps]
xyz = [ [cos(p), sin(p), sin(t)] for t in ts for p in ps]
g.plot(graph.data.points(xyz,
x=1, y=2, z=3),
[graph.style.surface(backcolor=None,gridcolor=color.gray.black)])
g.writePDFfile(__file__[:-3])
/usr/lib64/python2.6/site-packages/pyx/text.py:888: DeprecationWarning:
os.popen4 is deprecated. Use the subprocess module.
self.texinput, self.texoutput = os.popen4("%s%s %s" % (self.mode,
ipcflag, self.texfilename), "t", 0)
Traceback (most recent call last):
File "kugel.py", line 15, in <module>
g.writePDFfile(__file__[:-3])
File "/usr/lib64/python2.6/site-packages/pyx/canvas.py", line 330, in
wrappedindocument
return method(d, file)
File "/usr/lib64/python2.6/site-packages/pyx/document.py", line 161,
in writePDFfile
pdfwriter.PDFwriter(self, file, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/pyx/pdfwriter.py", line 475,
in __init__
catalog = PDFcatalog(document, self, registry)
File "/usr/lib64/python2.6/site-packages/pyx/pdfwriter.py", line 155,
in __init__
self.PDFpages = PDFpages(document, writer, registry)
File "/usr/lib64/python2.6/site-packages/pyx/pdfwriter.py", line 212,
in __init__
page = PDFpage(page, pageno, self, writer, registry)
File "/usr/lib64/python2.6/site-packages/pyx/pdfwriter.py", line 238,
in __init__
self.PDFcontent = PDFcontent(page, writer, self.pageregistry)
File "/usr/lib64/python2.6/site-packages/pyx/pdfwriter.py", line 267,
in __init__
page.processPDF(contentfile, writer, acontext, registry, self.bbox)
File "/usr/lib64/python2.6/site-packages/pyx/document.py", line 141,
in processPDF
self._process("processPDF", *args)
File "/usr/lib64/python2.6/site-packages/pyx/document.py", line 81, in
_process
getattr(self.canvas, processMethod)(canvasfile, writer, context,
registry, bbox)
File "/usr/lib64/python2.6/site-packages/pyx/graph/graph.py", line
167, in processPDF
canvas.canvas.processPDF(self, file, writer, context, registry, bbox)
File "/usr/lib64/python2.6/site-packages/pyx/canvas.py", line 216, in
processPDF
item.processPDF(file, writer, context, registry, nbbox)
File "/usr/lib64/python2.6/site-packages/pyx/mesh.py", line 127, in
processPDF
thisbbox = self.bbox()
File "/usr/lib64/python2.6/site-packages/pyx/mesh.py", line 99, in bbox
return bbox.bbox_pt(min([node.coords_pt[0] for element in
self.elements for node in element.nodes]),
ValueError: min() arg is an empty sequence
------------------------------------------------------------------------------
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