Hi Sybren,

yeah, I'm sorry about this incompatible change. It was a serious
problem which needed to be fixed. See
http://sourceforge.net/mailarchive/message.php?msg_id=34318807 for
some comments about that.

Your case requires a quite minimal change: You just have to create the
proper tuples in the data lists. Let me show you this in the quoted
source:

On 03.08.06, Sybren Stüvel wrote:
> def plotbars(filename, *args):
>     '''Plots een bargraph.
> 
>     De grafiek wordt opgeslagen als EPS in de file genaamd 'filename'.
> 
>     De argumenten moeten tuples zijn van vier waarden:
>         - Jaartal
>         - Aanwezig inkomen
>         - Gewenst inkomen
>         - Tekort
>     '''
> 
>     log.debug('Plotting graph in "%s"' % filename)
> 
>     # Create the graph, with the proper colours and key.
>     palette = UPNPalette()
>     mynestedbaraxis = pyx.graph.axis.bar(
>             defaultsubaxis=pyx.graph.axis.bar(
>                 dist=0.2,
>                 painter=None
>             )
>     )
>     key = pyx.graph.key.key(hinside=0)
>     texter = pyx.graph.axis.texter.decimal()
>     g = pyx.graph.graphxy(
>             width=8,
>             x=mynestedbaraxis,
>             y=pyx.graph.axis.linear(texter=texter),
>             key=key
>             )
> 
>     aanwezig_data = [(a[0], a[1]) for a in args]
>     gewenst_data = [(a[0], a[2]) for a in args]
>     tekort_data = [(a[0], a[3]) for a in args]

    aanwezig_data = [((a[0], 0), a[1]) for a in args]
    gewenst_data = [((a[0], 1), a[2]) for a in args]
    tekort_data = [((a[0], 2), a[3]) for a in args]

> 
>     # Build a list data lists
>     gewenst = pyx.graph.data.list(gewenst_data, xname=1, y=2, title='Gewenst')
>     aanwezig = pyx.graph.data.list(aanwezig_data,xname=1, y=2, 
> title='Aanwezig')
>     tekort = pyx.graph.data.list(tekort_data, xname=1, y=2, title='Tekort')
> 
>     # Draw the graph
>     g.plot([gewenst, aanwezig, tekort],
>         [
>             pyx.graph.style.barpos(fromvalue=0),
>             pyx.graph.style.bar([palette])
>         ])
> 
>     # Write the EPS
>     g.writeEPSfile(filename)
> 
> def main():
>     plot = plotbars('plot1',
>             (2030, 12410, 93021, -3020),
>             (2031, 12410, 93021, -3020),
>             (2036, 12410, 93021, -3020)
>         )

HTH,

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