Charts

Jeff Blaine jblaine at shell2.shore.net
Tue Feb 1 17:26:29 EST 2000


On Thu, 27 Jan 2000 15:31:41 -0700, Thierry Thelliez <thierry at acm.org> wrote:
>Is there any packages for creating charts (histograms, scattered plots,
>line charts,...) in Python ?

I had this very same need recently.  I got all excited about the Gnuplot
module until I found out that it requires the Numeric C extension to Python.
Was immediately disinterested, as I saw no reason for a pipe-based wrapper
to require a C extension.

I ended up doing the following

        [ ... snip ... ]
        # Create a data file here with the full path stored in 'tmpfilename'
        gnuplot = os.popen('gnuplot', 'w')
        gnuplot.write('set terminal gif\n')
        gnuplot.write('set output "' + myfilename + '"\n')
        gnuplot.write('set format "%.0f"\n')
        gnuplot.write('plot "' + tmpfilename + '" with lines\n')
        gnuplot.flush()
        gnuplot.close()
        [ ... snip ... ]



More information about the Python-list mailing list