Hi Gabrielle,
Sorry for the confusion. The doc you're looking at seems to come from
the current development branch. The dxunit/dyunit feature was added
after the PyX 0.9 release. Still, you can take the text style from svn
and use it on top of PyX 0.9. Shouldn't make any problems.
Best
André
On 29.07.07, Gabrielle David wrote:
> Hi,
>
> I have a graph where I want to label each symbol with its own text to
> identify it. I know I can do this using graph.style.text and specifying a
> text= column and a general dx= and dy= for placement. The problem with this
> is that since some of the symbols are close together the text labels then
> overlap.
>
> So I would like to specify the positions of the symbol labels individually,
> to make the layout nicer. I was reading that you can do this by specifying a
> dxname= and a dyname= column containing values and then a dxunit= and a
> dyunit=. Well at this that is what I understand this to mean from the Pyx
> manual:
> "Alternatively you can specify a dxname and a dyname and provide appropriate
> data in those columns to be taken in units of dxunit and dyunit to specify
> the position of the text for each point separately."
>
> I have tried this but it comes up with an error of " TypeError: __init__()
> got an unexpected keyword argument 'dxunit'"
>
> I am not sure if this is the way I have my script set up or if I am
> misinterpreting what the dxname/dxunit functionality is for.
>
> Could someone please tell me how to individually specify the position of the
> labels?
>
> This is my script:
>
> from pyx import*
>
> text.set(mode="latex")
>
> text.preamble("\usepackage{wasysym}")
>
> text.preamble("\usepackage[version=3]{mhchem}")
>
> c = canvas.canvas()
>
> g1=graph.graphxy(width=8,x=graph.axis.linear(min=0,max=70,title="cumulative
> \%
> yield"),y=graph.axis.linear(min=-20,max=20,title="$\delta$\ce{^{15}N}$_{AIR}
> $ \permil"))
>
> g1.plot(graph.data.file("roomn.dat", x=2, y=3, text=1, dxname=4, dyname=5,
> title="precipitated at room
> temperature"),[graph.style.symbol(graph.style.symbol.square,
> size=0.15*unit.v_cm,
> symbolattrs=[deco.stroked([color.rgb.black]),deco.filled([color.rgb.white])]
> ), graph.style.text(dxunit=0.25*unit.v_cm, dyunit=0.25*unit.v_cm)])
>
> c.insert(g1)
>
> g2=graph.graphxy(width=8,x=graph.axis.linear(min=0,max=70,title="cumulative
> \%
> yield"),y=graph.axis.linear(min=-30,max=30,title="$\delta$\ce{^{2}H}$_{SMOW}
> $ \permil"),ypos=g1.ypos+g1.height+2)
>
>
> g2.plot(graph.data.file("roomd.dat", x=2, y=3, text=1, dxname=4, dyname=5,
> title="precipitated at room
> temperature"),[graph.style.symbol(graph.style.symbol.square,
> size=0.15*unit.v_cm,
> symbolattrs=[deco.stroked([color.rgb.black]),deco.filled([color.rgb.black])]
> ), graph.style.text(dxunit=0.25*unit.v_cm, dyunit=0.25*unit.v_cm)])
>
> c.insert(g2)
>
> c.writePDFfile("room")
>
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> PyX-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-user
--
by _ _ _ Dr. André Wobst
/ \ \ / ) [EMAIL PROTECTED], http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user