blob: a1a1ae869bbf5984c69f8f6a7e9076893d358e7c [file] [log] [blame]
avm9996345a8a462022-06-04 12:41:03 +02001#!/usr/bin/env -S gnuplot -c
Adrià Vilanova Martínezc102e962022-06-04 23:53:44 +02002outputfile = 'data_out/dep_en_L_graphs/' # Nom de la imatge resultant (sense extensió)
3datafilepre = 'data_out/dep_en_L/tmpdata/'
avm9996345a8a462022-06-04 12:41:03 +02004datafilepost = '.dat'
Adrià Vilanova Martínezc102e962022-06-04 23:53:44 +02005LS = ARG1
avm9996345a8a462022-06-04 12:41:03 +02006
Adrià Vilanova Martínez5c444792022-06-07 18:17:00 +02007svgTerminal = "set terminal svg dashed size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\"; pointSize=0.5"
8pngTerminal = "set terminal pngcairo size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\"; pointSize=0.7"
9graphStyle = "with linespoints pointsize pointSize"
10
11set style line 101 lc rgb '#808080' lt 1 lw 1
12set border 3 front ls 101
13set tics nomirror out scale 0.75
14set style line 102 lc rgb '#d6d7d9' lt 0 lw 1
15set grid back ls 102
avm9996345a8a462022-06-04 12:41:03 +020016
Adrià Vilanova Martínezd2f8c712022-06-05 22:41:03 +020017set xlabel "Temperatura (K)"
18set yrange [*<0:0<*]
19# ------------------------------------
20# Gràfica per la capacitat calorífica:
21# ------------------------------------
22set title "Capacitat calorífica per diferents valors d'L"
Adrià Vilanova Martínezc102e962022-06-04 23:53:44 +020023
Adrià Vilanova Martínezd2f8c712022-06-05 22:41:03 +020024@svgTerminal
25set output outputfile.'capacitat_calorifica.svg'
26plot for [L in LS] datafilepre . L . datafilepost using 2:10 @graphStyle title "L = ".L
Adrià Vilanova Martínezc102e962022-06-04 23:53:44 +020027
Adrià Vilanova Martínezd2f8c712022-06-05 22:41:03 +020028@pngTerminal
29set output outputfile.'capacitat_calorifica.png'
30replot
31
32# ----------------------------------------
33# Gràfica per la susceptibilitat magnètica
34# ----------------------------------------
35set title "Susceptibilitat magnètica per diferents valors d'L"
36
37@svgTerminal
38set output outputfile.'susceptibilitat_magnetica.svg'
39plot for [L in LS] datafilepre . L . datafilepost using 2:11 @graphStyle title "L = ".L
40
41@pngTerminal
42set output outputfile.'susceptibilitat_magnetica.png'
43replot
44
45# ---------------------
46# Gràfica per l'energia
47# ---------------------
Adrià Vilanova Martínez5c444792022-06-07 18:17:00 +020048do for [IDX = 0:1] {
49 if (IDX == 0) {
50 @svgTerminal
51 set output outputfile.'energia.svg'
52 } else {
53 @pngTerminal
54 set output outputfile.'energia.png'
55 }
Adrià Vilanova Martínezd2f8c712022-06-05 22:41:03 +020056
Adrià Vilanova Martínez5c444792022-06-07 18:17:00 +020057 set multiplot
Adrià Vilanova Martínezc102e962022-06-04 23:53:44 +020058
Adrià Vilanova Martínez5c444792022-06-07 18:17:00 +020059 set origin 0, 0
60 set size 1, 1
61 set title "Energia per diferents valors de L"
62 set xlabel "Temperatura (K)"
63 set key bottom right
64 set key noopaque
65 set autoscale x
66 set yrange [*<0:0<*]
67 unset object 1
68 plot for [L in LS] datafilepre . L . datafilepost using 2:($3/(L**2)) @graphStyle title "<E>/N, L = ".L, \
69 for [L in LS] datafilepre . L . datafilepost using 2:(-sqrt($4)/(L**2)) @graphStyle title "-sqrt(<E^2>)/N, L = ".L
70
71 set origin 0.1, 0.525
72 set size 0.6, 0.4
73 set title ""
74 set xlabel ""
75 set key off
76 set xrange [2.25:2.5]
77 set yrange [-1.6:-1.1]
78 set object 1 rectangle from graph 0,0 to graph 1,1 behind fillcolor rgb 'white' fillstyle solid noborder
79 replot
80
81 unset multiplot
82}
83
84set origin 0, 0
85set size 1, 1
86set autoscale x
87set yrange [*<0:0<*]
88set xlabel "Temperatura (K)"
89unset object 1
Adrià Vilanova Martínezd2f8c712022-06-05 22:41:03 +020090
91# ----------------------------
92# Gràfica per la magnetització
93# ----------------------------
94set title "Magnetització per diferents valors d'L"
95
96@svgTerminal
97set output outputfile.'magnetitzacio.svg'
Adrià Vilanova Martínezc102e962022-06-04 23:53:44 +020098set key top right
Adrià Vilanova Martínezd2f8c712022-06-05 22:41:03 +020099plot for [L in LS] datafilepre . L . datafilepost using 2:($7/(L**2)) @graphStyle title "<|M|>/N, L = ".L, \
100 for [L in LS] datafilepre . L . datafilepost using 2:(sqrt($8)/(L**2)) @graphStyle title "sqrt(<M^2>)/N, L = ".L
101
102@pngTerminal
103set output outputfile.'magnetitzacio.png'
104replot