From: Carl B. <dr...@gm...> - 2006-07-28 14:51:23
|
Hi, I need help again :( I have several source file that generated nice plots that don't work anymore, here is an example: ___________________________ 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", 0], ["DHT", 53]], xname=1, y=2), graph.data.list([["GDX", 3324927], ["DHT", 2738075]], xname=1, y2=2)], [graph.style.barpos(fromvalue=0, subnames = ["SAGE", "Q\_RT-PCR"]), graph.style.bar(barattrs=[color.palette.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 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' ___________________________ Here is how it was looking before: http://agora.ulaval.ca/~cabol36/acadvl.png I guess that i was using a different version of Pyx. What should I do now? Thanks, carl |
From: Michael J G. <mic...@fa...> - 2006-07-28 15:43:28
|
Carl Bolduc venit, vidit, dixit 2006-07-28 16:51: > Hi, I need help again :( > > I have several source file that generated nice plots that don't work > anymore, here is an example: ... > Here is how it was looking before: > http://agora.ulaval.ca/~cabol36/acadvl.png I guess that i was using a > different version of Pyx. What should I do now? > > Thanks, > > carl I keep all PyX versions I use around so that I can regenerate plots without changing the code. Whenever I reuse code I first make sure to adapt it to the current version of PyX, then build upon it. That comes with using software which is under active development! Let us know if you need hints on how to use several versions of PyX concurrently. Cheers Michael |
From: Gert I. <Gert.Ingold@Physik.Uni-Augsburg.DE> - 2006-07-28 15:58:16
|
On Fri, Jul 28, 2006 at 05:43:19PM +0200, Michael J Gruber wrote: > Carl Bolduc venit, vidit, dixit 2006-07-28 16:51: > > Hi, I need help again :( > >=20 > > I have several source file that generated nice plots that don't work=20 > > anymore, here is an example: > ... > > Here is how it was looking before:=20 > > http://agora.ulaval.ca/~cabol36/acadvl.png I guess that i was using a > > different version of Pyx. What should I do now? > >=20 > > Thanks, > >=20 > > carl >=20 > I keep all PyX versions I use around so that I can regenerate plots > without changing the code. Whenever I reuse code I first make sure to > adapt it to the current version of PyX, then build upon it. That comes > with using software which is under active development! >=20 In this respect, it may be useful to take a look at the FAQ: 1.4 How can I access older versions of PyX? Best regards, Gert --=20 Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut f=FCr Physik Phone: +49-821-598-3234 Universit=E4t Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
From: Michael S. <mic...@ph...> - 2006-07-28 16:57:05
|
> I guess that i was using a different version of Pyx. What should I do now? You can figure out the old version from an old .eps file. Open it with your favourite text editor and search a line such as %%Creator: PyX 0.9 Michael. -- "A mathematician is a device for turning coffee into theorems" Paul Erdös. |
From: Carl B. <dr...@gm...> - 2006-07-28 17:25:52
|
Thanks guys, I found a compatible version of PyX :D |
From: Andre W. <wo...@us...> - 2006-07-28 17:55:43
|
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 / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ |