# -*- coding:iso-8859-1 -*- import os DATAFILE='xrddata.dat' PLOTFILE='xrddata.png' LOWER=35 UPPER=36.5 f=os.popen('gnuplot' ,'w') print >>f, "set xrange [%f:%f]" % (LOWER,UPPER) print >>f, "set xlabel 'Angle de diffraction'; set ylabel 'Nombre'" print >>f, "plot '%s' using 1:2:(sqrt($2)) with errorbars title 'donnees XRPD' lw 3" % DATAFILE print >>f, "set terminal png large transparent size 600,400; set out '%s'" % PLOTFILE print >>f, "pause 2; replot" f.flush()