#!/usr/bin/gnuplot
# gnuplot 4.6 / Debian GNU/Linux 7
reset
set terminal svg
set output "signal_5.svg"
unset key
set tics scale 0.5
set multiplot
a = 0.22
set size 1,a
set origin 0,0.8
set title offset 0, -2 textcolor rgb "blue" "Pas de signal - Ordre confort"
set samples 1000
set nokey
set xrange [-3*pi:7*pi]
set yrange [-1:1]
unset xtics
unset ytics
plot 1/0
set size 1,a
set origin 0,0.64
set title offset 0, -2 "Signal 220v - Ordre éco"
set samples 1000
set nokey
unset xtics
unset ytics
plot sin(x)*0.5 with lines lc rgb "red"
set size 1,a
set origin 0,0.48
set title offset 0, -2 "Alternance négative 220v - Ordre hors-gel"
set samples 1000
set nokey
unset xtics
unset ytics
f(x) = 0.5*sin(x)
g(x) = f(x)<=0 ? f(x) : 0
set xrange [-3*pi:7*pi]
set yrange [-1:1]
plot g(x) with lines lc rgb "red"
set size 1,a
set origin 0,0.32
set title offset 0, -2 "Alternance positive 220v - Ordre arrêt"
set samples 1000
set nokey
unset xtics
unset ytics
f2(x) = 0.5*sin(x)
g2(x) = f2(x)>=0 ? f2(x) : 0
set xrange [-3*pi:7*pi]
set yrange [-1:1]
plot g2(x) with lines lc rgb "red"
set size 1,a
set origin 0,0.16
set title offset 0, -2 "Signal temporisé - Ordre confort -1°C"
set samples 1000
set nokey
unset xtics
unset ytics
set label 1 "4'57\"" at (-2*pi),-0.7
set label 2 "3\"" at (0.9*pi),-0.7
set label 3 "4'57\"" at (3.2*pi),-0.7
set label 4 "3\"" at (5.9*pi),-0.7
set arrow 1 from 0, -0.8, 0 to 0, 0.5, 0 nohead back nofilled linetype -1 linewidth 1.000
set arrow 2 from (2*pi), -0.8, 0 to (2*pi), 0.5, 0 nohead back nofilled linetype -1 linewidth 1.000
set arrow 3 from (5*pi), -0.8, 0 to (5*pi), 0.6, 0 nohead back nofilled linetype -1 linewidth 1.000
set xrange [-3*pi:7*pi]
set yrange [-1:1]
f3(x) = 0.5*sin(x)
g3(x) = x<=2*pi&&x>=0 ? f3(x) : (x>=5*pi ? -0.5*sin(x) : 0)
plot g3(x) with lines lc rgb "red"
set size 1,a
set origin 0,0
set title offset 0, -2 "Signal temporisé - Ordre confort -2°C"
set samples 1000
set nokey
unset xtics
unset ytics
set label 1 "4'53\"" at (-1*pi),-0.5
set label 2 "7\"" at (0.9*pi),-0.5
set label 3 "4'53\"" at (2.7*pi),-0.5
set label 4 "7\"" at (4.9*pi),-0.5
set arrow 1 from 0, -0.8, 0 to 0, 0.5, 0 nohead back nofilled linetype -1 linewidth 1.000
set arrow 2 from (2*pi), -0.8, 0 to (2*pi), 0.5, 0 nohead back nofilled linetype -1 linewidth 1.000
set arrow 3 from (4*pi), -0.8, 0 to (4*pi), 0.5, 0 nohead back nofilled linetype -1 linewidth 1.000
set xrange [-2*pi:6*pi]
set yrange [-1:1]
f4(x) = 0.5*sin(x)
g4(x) = x<=2*pi&&x>=0 ? f4(x) : (x>=4*pi ? f4(x) : 0)
plot g4(x) with lines lc rgb "red"
unset multiplot
set output