Hi Chris,

well it seems this feature is not implemented. I'm also not sure if it is even 
possible in a sane way.

However if you are using graph.style.text together with another style, you can 
try the following:



class mytextstyle(graph.style.text):
    def key_pt(self, privatedata, sharedata, graph, x_pt, y_pt, width_pt,   
               height_pt):
        pass


# [your code]

# then use mytextstyle instead of graph.style.text
g.plot(data, [graph.style.line(), mytextstyle()])


This should provide a key where the style is determined by the linestyle and 
text has no influence.

Gruß,
Stefan


Am Sonntag, 7. März 2010 02:47:14 schrieb Chris van Dijk:
> Hey all,
> 
> I am having some issues putting both a key and some text with the points
> on the same graph. The error I get is as follows:
> 
>   RuntimeError: Style currently doesn't provide a graph key
> 
> I am using version 0.10-4 from the Arch repos.
> Here is a minimum working example:
> 
> from pyx import *
> 
> text.set(mode='latex')
> 
> pts = [1, 2, 3, 4]
> txt = ['a', 'b', 'c', 'd']
> data = graph.data.points(zip(pts,txt), x=0, y=1, text=2)
> 
> g = graph.graphxy(width=8, key=graph.key.key())
> 
> g.plot(data, [graph.style.text()])
> 
> g.writePDFfile('mwe')
> 
> 
> Ignore the second command, for some reason I get errors if I _don't_
> set the text mode to latex, but that is a problem for another day...
> 
> Thanks for your help,
> 
> Chris
> 
> 
> ---------------------------------------------------------------------------
> --- Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> PyX-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-user


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to