avm99963 | 45a8a46 | 2022-06-04 12:41:03 +0200 | [diff] [blame] | 1 | #!/usr/bin/env -S gnuplot -c |
Adrià Vilanova Martínez | c102e96 | 2022-06-04 23:53:44 +0200 | [diff] [blame] | 2 | outputfile = 'data_out/dep_en_L_graphs/' # Nom de la imatge resultant (sense extensió) |
| 3 | datafilepre = 'data_out/dep_en_L/tmpdata/' |
avm99963 | 45a8a46 | 2022-06-04 12:41:03 +0200 | [diff] [blame] | 4 | datafilepost = '.dat' |
Adrià Vilanova Martínez | c102e96 | 2022-06-04 23:53:44 +0200 | [diff] [blame] | 5 | LS = ARG1 |
avm99963 | 45a8a46 | 2022-06-04 12:41:03 +0200 | [diff] [blame] | 6 | |
Adrià Vilanova Martínez | 5c44479 | 2022-06-07 18:17:00 +0200 | [diff] [blame] | 7 | svgTerminal = "set terminal svg dashed size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\"; pointSize=0.5" |
| 8 | pngTerminal = "set terminal pngcairo size 800, 800 font \"Computer Modern,Tinos,Helvetica,15\"; pointSize=0.7" |
| 9 | graphStyle = "with linespoints pointsize pointSize" |
| 10 | |
| 11 | set style line 101 lc rgb '#808080' lt 1 lw 1 |
| 12 | set border 3 front ls 101 |
| 13 | set tics nomirror out scale 0.75 |
| 14 | set style line 102 lc rgb '#d6d7d9' lt 0 lw 1 |
| 15 | set grid back ls 102 |
avm99963 | 45a8a46 | 2022-06-04 12:41:03 +0200 | [diff] [blame] | 16 | |
Adrià Vilanova Martínez | d2f8c71 | 2022-06-05 22:41:03 +0200 | [diff] [blame] | 17 | set xlabel "Temperatura (K)" |
| 18 | set yrange [*<0:0<*] |
| 19 | # ------------------------------------ |
| 20 | # Gràfica per la capacitat calorífica: |
| 21 | # ------------------------------------ |
| 22 | set title "Capacitat calorífica per diferents valors d'L" |
Adrià Vilanova Martínez | c102e96 | 2022-06-04 23:53:44 +0200 | [diff] [blame] | 23 | |
Adrià Vilanova Martínez | d2f8c71 | 2022-06-05 22:41:03 +0200 | [diff] [blame] | 24 | @svgTerminal |
| 25 | set output outputfile.'capacitat_calorifica.svg' |
| 26 | plot for [L in LS] datafilepre . L . datafilepost using 2:10 @graphStyle title "L = ".L |
Adrià Vilanova Martínez | c102e96 | 2022-06-04 23:53:44 +0200 | [diff] [blame] | 27 | |
Adrià Vilanova Martínez | d2f8c71 | 2022-06-05 22:41:03 +0200 | [diff] [blame] | 28 | @pngTerminal |
| 29 | set output outputfile.'capacitat_calorifica.png' |
| 30 | replot |
| 31 | |
| 32 | # ---------------------------------------- |
| 33 | # Gràfica per la susceptibilitat magnètica |
| 34 | # ---------------------------------------- |
| 35 | set title "Susceptibilitat magnètica per diferents valors d'L" |
| 36 | |
| 37 | @svgTerminal |
| 38 | set output outputfile.'susceptibilitat_magnetica.svg' |
| 39 | plot for [L in LS] datafilepre . L . datafilepost using 2:11 @graphStyle title "L = ".L |
| 40 | |
| 41 | @pngTerminal |
| 42 | set output outputfile.'susceptibilitat_magnetica.png' |
| 43 | replot |
| 44 | |
| 45 | # --------------------- |
| 46 | # Gràfica per l'energia |
| 47 | # --------------------- |
Adrià Vilanova Martínez | 5c44479 | 2022-06-07 18:17:00 +0200 | [diff] [blame] | 48 | do 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ínez | d2f8c71 | 2022-06-05 22:41:03 +0200 | [diff] [blame] | 56 | |
Adrià Vilanova Martínez | 5c44479 | 2022-06-07 18:17:00 +0200 | [diff] [blame] | 57 | set multiplot |
Adrià Vilanova Martínez | c102e96 | 2022-06-04 23:53:44 +0200 | [diff] [blame] | 58 | |
Adrià Vilanova Martínez | 5c44479 | 2022-06-07 18:17:00 +0200 | [diff] [blame] | 59 | 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 | |
| 84 | set origin 0, 0 |
| 85 | set size 1, 1 |
| 86 | set autoscale x |
| 87 | set yrange [*<0:0<*] |
| 88 | set xlabel "Temperatura (K)" |
| 89 | unset object 1 |
Adrià Vilanova Martínez | d2f8c71 | 2022-06-05 22:41:03 +0200 | [diff] [blame] | 90 | |
| 91 | # ---------------------------- |
| 92 | # Gràfica per la magnetització |
| 93 | # ---------------------------- |
| 94 | set title "Magnetització per diferents valors d'L" |
| 95 | |
| 96 | @svgTerminal |
| 97 | set output outputfile.'magnetitzacio.svg' |
Adrià Vilanova Martínez | c102e96 | 2022-06-04 23:53:44 +0200 | [diff] [blame] | 98 | set key top right |
Adrià Vilanova Martínez | d2f8c71 | 2022-06-05 22:41:03 +0200 | [diff] [blame] | 99 | plot 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 |
| 103 | set output outputfile.'magnetitzacio.png' |
| 104 | replot |