Physique_et_informatique/ModeleLaTeX_TP-gnuplottex-fig20.gnuplot
2023-02-06 21:15:30 +01:00

62 lines
2.1 KiB
Gnuplot
Executable File

set terminal epslatex font 8 color dashed
set output './ModeleLaTeX_TP-gnuplottex-fig20.tex'
set format '\num{%g}'
set key top 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_s.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_s.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_s.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_s.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_s.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_s.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:35][0:9]\
'gene/data_gene_s.txt' index 0 u 1:2:3:4 title 'Accu.1 \SI{9}{\volt}' pt 4 w xyerrorbars,\
f(x) title title_f(a,b),\
'gene/data_gene_s.txt' index 1 u 1:2:3:4 title 'Accu.2 \SI{9}{\volt}' pt 4 w xyerrorbars,\
g(x) title title_g(c,d),\
'gene/data_gene_s.txt' index 2 u 1:2:3:4 title 'Accu.3 \SI{9}{\volt}' pt 4 w xyerrorbars,\
h(x) title title_h(e,f),\
'gene/data_gene_s.txt' index 3 u 1:2:3:4 title '8 accus \SI{1,2}{\volt}' pt 4 w xyerrorbars,\
i(x) title title_i(g,h),\
'gene/data_gene_s.txt' index 4 u 1:2:3:4 title 'Accu.4 \SI{9}{\volt}' pt 4 w xyerrorbars,\
j(x) title title_j(i,j),\
'gene/data_gene_s.txt' index 5 u 1:2:3:4 title 'Pile AAA R03 \SI{1,5}{\volt}' pt 4 w xyerrorbars,\
k(x) title title_k(k,l)