Physique_et_informatique/ModeleLaTeX_TP-gnuplottex-f...

22 lines
882 B
Gnuplot
Executable File

set terminal epslatex font 8 color dashed
set output './ModeleLaTeX_TP-gnuplottex-fig25.tex'
set format '\num{%g}'
set key bottom left Left
set key width 3.5
set key heigh 1
set key spacing 1.5
set xlabel 'Courant \(I\) (\si{\ampere})' # attention il faut parfois utiliser certains guillemets
# notamment quand on utilise la commande \si, il faut impérativement des primes '...'
set ylabel 'Puissance \(P_{mec}\) (\si{\milli\watt})'
# Création du fit des données
# la fonction de fit
f(x)=a*x**2+b*x+c
fit f(x) 'moteur/data_mot_hall_poids2.txt' index 0 u 4:($2*$4) via a,b,c
title_f(a,b,c) = sprintf('Parabolique : \({%.3f}\cdot x^2+{%.1f}\cdot x+{%.1f}\)',a,b,c)
plot [100:300][0:800]\
'moteur/data_mot_hall_poids2.txt' index 0 u 4:($2*$4):8:($4*$6+$2*$8) title 'Moteur inconnu, \(I_{max}=\SI{400}{\milli\ampere}\)' pt 4 w xyerrorbars,\
f(x) title title_f(a,b,c) lc 'violet'