Hi Carl,

On 28.07.06, Carl Bolduc wrote:
> I have several source file that generated nice plots that don't work
> anymore, here is an example:
[snip]
> I get this error now:
> ___________________________
> Traceback (most recent call last):
>  File "lpl.py", line 19, in ?
>    [graph.style.barpos(fromvalue=0, subnames = ["SAGE", "Q\_RT-PCR"]),
> graph.style.bar(barattrs=[color.palette.ReverseGray])])
> TypeError: __init__() got an unexpected keyword argument 'subnames'
> ___________________________

Yes, this is an incompatible change in PyX 0.9. Still, it was a
complete missfeature in older versions to do very scary things in the
bar style to properly support nested bar styles. This change was also
mentioned in the release note (see pyx.sf.net/index.html or the
release notes as available at the file download:
http://sourceforge.net/project/shownotes.php?release_id=419531&group_id=45430)

Instead of setting subnames and modifying the data within the bar
style, you can now set lists in the data constructor. (BTW, when
providing data by a list, this would have been possible before, but
when using a file and expressions on that file, this was not possible
in earlier versions since you couldn't work with tuples in the data
expressions before.)

Anyway. The modified source which runs on PyX 0.9 now reads:

-----------------------------
from pyx import *

text.set(mode="latex")

mynestedbaraxis = graph.axis.bar(defaultsubaxis=graph.axis.bar(dist=0))

g = graph.graphxy(width=8, x=mynestedbaraxis,
   y=graph.axis.lin(min=0, max=60, title="Number of SAGE tags"),
   y2=graph.axis.lin(min=0, max=3500000, title="Number of copies/$\mu$g of 
total RNA"),
   x2=None)

g.plot([graph.data.list([[("GDX", "SAGE"), 0], [("DHT", "SAGE"), 53]], xname=1, 
y=2),
        graph.data.list([[("GDX", "Q\_RT-PCR"), 3324927], [("DHT", 
"Q\_RT-PCR"), 2738075]], xname=1, y2=2)],
       [graph.style.barpos(fromvalue=0),
        graph.style.bar(barattrs=[color.linearpalette.ReverseGray])])

g.text(g.width/2, g.height + 0.5, "Acyl-Coenzyme A dehydrogenase very long 
chain",
      [text.halign.center, text.valign.bottom])

g.writeEPSfile("acadvl")
-----------------------------

I'm sorry about those incombatible changes but this change clearly
repairs a major design mistake we did before do to the mathtree we
used before, which was crap from the very beginning ... :-(


André

-- 
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/

-------------------------------------------------------------------------
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

Reply via email to