Fenòmens p4: improve graph design

Change-Id: I657a5093eff8a26b5d90c0932eae550209643cff
diff --git a/quad10/fenomens/lab/p4/graphs/dependenciaEnL.gnu b/quad10/fenomens/lab/p4/graphs/dependenciaEnL.gnu
index 8061b30..a1a1ae8 100755
--- a/quad10/fenomens/lab/p4/graphs/dependenciaEnL.gnu
+++ b/quad10/fenomens/lab/p4/graphs/dependenciaEnL.gnu
@@ -4,9 +4,15 @@
 datafilepost = '.dat'
 LS = ARG1
 
-graphStyle = "with linespoints pointsize 0.7"
-svgTerminal = "set terminal svg dashed size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\""
-pngTerminal = "set terminal pngcairo size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\""
+svgTerminal = "set terminal svg dashed size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\"; pointSize=0.5"
+pngTerminal = "set terminal pngcairo size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\"; pointSize=0.7"
+graphStyle = "with linespoints pointsize pointSize"
+
+set style line 101 lc rgb '#808080' lt 1 lw 1
+set border 3 front ls 101
+set tics nomirror out scale 0.75
+set style line 102 lc rgb '#d6d7d9' lt 0 lw 1
+set grid back ls 102
 
 set xlabel "Temperatura (K)"
 set yrange [*<0:0<*]
@@ -39,17 +45,48 @@
 # ---------------------
 # Gràfica per l'energia
 # ---------------------
-set title "Energia per diferents valors d'L"
+do for [IDX = 0:1] {
+  if (IDX == 0) {
+    @svgTerminal
+    set output outputfile.'energia.svg'
+  } else {
+    @pngTerminal
+    set output outputfile.'energia.png'
+  }
 
-@svgTerminal
-set output outputfile.'energia.svg'
-set key bottom right
-plot for [L in LS] datafilepre . L . datafilepost using 2:($3/(L**2)) @graphStyle title "<E>/N, L = ".L, \
-     for [L in LS] datafilepre . L . datafilepost using 2:(-sqrt($4)/(L**2)) @graphStyle title "-sqrt(<E^2>)/N, L = ".L
+  set multiplot
 
-@pngTerminal
-set output outputfile.'energia.png'
-replot
+  set origin 0, 0
+  set size 1, 1
+  set title "Energia per diferents valors de L"
+  set xlabel "Temperatura (K)"
+  set key bottom right
+  set key noopaque
+  set autoscale x
+  set yrange [*<0:0<*]
+  unset object 1
+  plot for [L in LS] datafilepre . L . datafilepost using 2:($3/(L**2)) @graphStyle title "<E>/N, L = ".L, \
+       for [L in LS] datafilepre . L . datafilepost using 2:(-sqrt($4)/(L**2)) @graphStyle title "-sqrt(<E^2>)/N, L = ".L
+
+  set origin 0.1, 0.525
+  set size 0.6, 0.4
+  set title ""
+  set xlabel ""
+  set key off
+  set xrange [2.25:2.5]
+  set yrange [-1.6:-1.1]
+  set object 1 rectangle from graph 0,0 to graph 1,1 behind fillcolor rgb 'white' fillstyle solid noborder
+  replot
+
+  unset multiplot
+}
+
+set origin 0, 0
+set size 1, 1
+set autoscale x
+set yrange [*<0:0<*]
+set xlabel "Temperatura (K)"
+unset object 1
 
 # ----------------------------
 # Gràfica per la magnetització