My graph is almost ready:
__________________________
from pyx import *
text.set(mode="latex")
g = graph.graphxy(width=20,
x=graph.axis.lin(min=-28, max=28, title="$Log_2(SAGE-ratio)$"),
x2=None,
y=graph.axis.lin(min=-28, max=28, title="$Log_2(Q\_RT-PCR-ratio)$"),
y2=None,
key=graph.key.key(pos="br", dist=0.1)
)
g.plot(graph.data.file("explevels.dat ", x=1, y=2, text=3), [graph.style.symbol(), graph.style.text()])
g.plot(graph.data.function("x(y)=y", title=r"$x = y$"))
g.writeEPSfile("minimal")
g.writePDFfile("minimal")
_________________________
my only problem is that when I added the "key=graph.key.key(pos="br", dist=0.1)" to label my function, I get this error:
_________________________
python q_rt- pcr.py
Traceback (most recent call last):
File "q_rt-pcr.py", line 17, in ?
g.writeEPSfile("minimal")
File "/usr/lib/python2.4/site-packages/pyx/canvas.py", line 329, in wrappedindocument
return method(d, file)
File "/usr/lib/python2.4/site-packages/pyx/document.py", line 155, in writeEPSfile
pswriter.epswriter(self, file, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/pyx/pswriter.py", line 278, in __init__
page.processPS(pagefile, self, acontext, registry, pagebbox)
File "/usr/lib/python2.4/site-packages/pyx/document.py", line 138, in processPS
self._process("processPS", *args)
File "/usr/lib/python2.4/site-packages/pyx/document.py", line 81, in _process
getattr(self.canvas, processMethod)(canvasfile, writer, context, registry, bbox)
File "/usr/lib/python2.4/site-packages/pyx/graph/graph.py", line 157, in processPS
self.finish()
File "/usr/lib/python2.4/site-packages/pyx/graph/graph.py", line 252, in finish
self.dokey()
File "/usr/lib/python2.4/site-packages/pyx/graph/graph.py", line 483, in dokey
c = self.key.paint(self.plotitems)
File "/usr/lib/python2.4/site-packages/pyx/graph/key.py", line 106, in paint
subc = self.paintcolumn(plotitems[:itemspercolumn])
File "/usr/lib/python2.4/site-packages/pyx/graph/key.py", line 92, in paintcolumn
titlebox.plotitem.key_pt(c, 0, y_pt, self.symbolwidth_pt, self.symbolheight_pt)
File "/usr/lib/python2.4/site-packages/pyx/graph/graph.py", line 111, in key_pt
style.key_pt(privatedata, self.sharedata, graph, x_pt, y_pt, width_pt, height_pt)
File "/usr/lib/python2.4/site-packages/pyx/graph/style.py", line 742, in key_pt
raise RuntimeError("Style currently doesn't provide a graph key")
RuntimeError: Style currently doesn't provide a graph key
___________________
Now what's wrong? I just used the same code line as in this example: http://pyx.sourceforge.net/examples/graphs/change.html
Bye,
carl
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
