Physique_et_informatique/ModeleLaTeX_TP-gnuplottex-fig21.gnuplot

62 lines
2.3 KiB
Plaintext
Raw Normal View History

2023-02-06 21:15:30 +01:00
set terminal epslatex font 8 color dashed
set output './ModeleLaTeX_TP-gnuplottex-fig21.tex'
set format '\num{%g}'
set key bottom right Left
set key width 1
set key heigh 1
set key spacing 1.5
set xlabel 'Courant I (\si{\milli\ampere})' # attention il faut parfois utiliser certains guillemets
# notamment quand on utilise la commande \si, il faut impérativement des primes '...'
set ylabel 'Tension U (\si{\volt})'
#Rmaxpot = 1200
# Création du fit des données
# la fonction de fit
f(x)=-a*x+b
fit f(x) 'gene/data_gene_9V_charge.txt' index 0 u 1:2 via a,b
R1=a*1000
title_f(a,b) = sprintf('--> fit : \(U(I) = {%.1f}\cdot I+{%.3f}\)', R1, b)
g(x)=-c*x+d
fit g(x) 'gene/data_gene_9V_charge.txt' index 1 u 1:2 via c,d
R2=c*1000
title_g(c,d) = sprintf('--> fit : \(U(I) = {%.1f}\cdot I+{%.3f}\)', R2, d)
h(x)=-e*x+f
fit h(x) 'gene/data_gene_9V_charge.txt' index 2 u 1:2 via e,f
R3=e*1000
title_h(e,f) = sprintf('--> fit : \(U(I) = {%.1f}\cdot I+{%.3f}\)', R3, f)
i(x)=-g*x+h
fit i(x) 'gene/data_gene_9V_charge.txt' index 3 u 1:2 via g,h
R4=g*1000
title_i(g,h) = sprintf('--> fit : \(U(I) = {%.1f}\cdot I+{%.3f}\)', R4, h)
j(x)=-i*x+j
fit j(x) 'gene/data_gene_9V_charge.txt' index 4 u 1:2 via i,j
R5=i*1000
title_j(i,j) = sprintf('--> fit : \(U(I) = {%.1f}\cdot I+{%.3f}\)', R5, j)
k(x)=-k*x+l
fit k(x) 'gene/data_gene_9V_charge.txt' index 5 u 1:2 via k,l
R6=k*1000
title_k(k,l) = sprintf('--> fit : \(U(I) = {%.1f}\cdot I+{%.3f}\)', R6, l)
#set style line 1 lt 0 lw 4
plot [0:54][0:10]\
'gene/data_gene_9V_charge.txt' index 5 u 1:2:3:4 title 'VARTA' pt 4 lc 'dark-blue' w xyerrorbars,\
k(x) title title_k(k,l) lc 'dark-blue',\
'gene/data_gene_9V_charge.txt' index 4 u 1:2:3:4 title 'ENERGIZER' pt 4 lc 'blue' w xyerrorbars,\
j(x) title title_j(i,j) lc 'blue',\
'gene/data_gene_9V_charge.txt' index 3 u 1:2:3:4 title 'ACCU ULTRA' pt 4 lc 'light-blue' w xyerrorbars,\
i(x) title title_i(g,h) lc 'light-blue',\
'gene/data_gene_9V_charge.txt' index 0 u 1:2:3:4 title 'ANSMAN' pt 4 lc 'light-red' w xyerrorbars,\
f(x) title title_f(a,b) lc 'light-red',\
'gene/data_gene_9V_charge.txt' index 1 u 1:2:3:4 title 'M POWER' pt 4 lc 'red' w xyerrorbars,\
g(x) title title_g(c,d) lc 'red',\
'gene/data_gene_9V_charge.txt' index 2 u 1:2:3:4 title 'DURACELL' pt 4 lc 'dark-red' w xyerrorbars,\
h(x) title title_h(e,f) lc 'dark-red'