Connecting to gnuplot with Popen?

Markus Weihs mweihs at gmx.at
Fri Mar 31 00:30:50 EST 2006


> I want to control gnuplot with a python program.

Hi Anton,

here is a little snippet using os.popen:


    import os

    gp = os.popen('gnuplot -persist', 'w')
    print >> gp, "set yrange [-300:300]"
    for n in range(300):
        print >> gp, "plot %i*cos(x)+%i*log(x+10)" % (n,150-n)


Regards, mawe




More information about the Python-list mailing list