#!/usr/bin/python

import Gnuplot, Gnuplot.funcutils
import glob
import os

# on visualise avec gnuplot
g = Gnuplot.Gnuplot(debug=0)

# X, Y en fonction de t
cmd=[]
ws="set title \"X fonction de t"
cmd.append(ws)
cmd.append('set xlabel "t"')
cmd.append('set ylabel "X(t)"')
cmd.append('set logscale y')
cmd.append('plot "res" title "X" w lp')
for i in cmd:
    g(i)

raw_input("Appuyer sur une touche pour continuer")

del cmd[0:len(cmd)]
ws="set title \"Y fonction de t"
cmd.append(ws)
cmd.append('set xlabel "t"')
cmd.append('set ylabel "Y(t)"')
cmd.append('set logscale y')
cmd.append('plot "res" u 1:3 title "Y" w lp')
for i in cmd:
    g(i)

raw_input("Appuyer sur une touche pour continuer")

del cmd[0:len(cmd)]
ws="set title \"Z fonction de t"
cmd.append(ws)
cmd.append('set xlabel "t"')
cmd.append('set ylabel "Z(t)"')
cmd.append('set logscale y')
cmd.append('plot "res"  u 1:4 title "Z"w lp')
for i in cmd:
    g(i)

raw_input("Appuyer sur une touche pour continuer")

del cmd[0:len(cmd)]
ws="set title \"Z en fonction de Y"
cmd.append(ws)
cmd.append('set xlabel "Y"')
cmd.append('set ylabel "Z"')
cmd.append('set logscale xy')
cmd.append('plot "res" u 3:4 title "Z(Y)" w lp')
for i in cmd:
    g(i)

raw_input("Appuyer sur une touche pour continuer")

del cmd[0:len(cmd)]
ws="set title \"X en fonction de Y"
cmd.append(ws)
cmd.append('set xlabel "Y"')
cmd.append('set ylabel "X"')
cmd.append('set logscale xy')
cmd.append('plot "res" u 3:2 title "X(Y)" w lp')
for i in cmd:
    g(i)

raw_input("Appuyer sur une touche pour continuer")
