2020-09-29 10:41:53 +02:00
|
|
|
%
|
|
|
|
% nouveau 27 septembre 2020
|
|
|
|
%
|
|
|
|
\chapter{Gnuplot}
|
2020-11-13 01:35:31 +01:00
|
|
|
\index{Gnuplot}\label{chap:gnuplot}
|
2020-09-29 10:41:53 +02:00
|
|
|
|
2020-11-25 14:24:19 +01:00
|
|
|
Gnuplot - an interactive plotting program
|
|
|
|
|
2021-06-27 04:32:47 +02:00
|
|
|
There is an on-line demo collection at http://gnuplot.info/demo
|
|
|
|
|
|
|
|
|
|
|
|
% -------------------------------------------------------------------
|
|
|
|
|
2020-09-29 10:41:53 +02:00
|
|
|
\section{Exemple : le phytotron}
|
|
|
|
\index{phytotron}
|
|
|
|
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
#!/bin/bash
|
2021-06-27 04:32:47 +02:00
|
|
|
# THIS IS A KLUDGE
|
2020-09-29 10:41:53 +02:00
|
|
|
|
|
|
|
nbsamp=3000 # nombre d'echantillon
|
|
|
|
|
|
|
|
if [ $# -eq 1 ]; then
|
|
|
|
nbsamp=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
DATAFILE="serial/foo.dat"
|
|
|
|
IMAGE="graphe.png"
|
|
|
|
TMPFILE="/dev/shm/tmpdata"
|
|
|
|
tail -${nbsamp} < ${DATAFILE} > ${TMPFILE}
|
|
|
|
|
|
|
|
gnuplot << __EOC__
|
|
|
|
set term png size 1600,800
|
|
|
|
set output "${IMAGE}"
|
|
|
|
set ytics 2
|
|
|
|
set xtics
|
|
|
|
set grid front
|
|
|
|
set title "* Temperatures du Phytotron *"
|
|
|
|
set xdata time
|
|
|
|
set timefmt "%s"
|
|
|
|
set format x "%b %d\n%H:%M"
|
|
|
|
set yrange [ 10.0 : 40.0 ]
|
|
|
|
plot "${TMPFILE}" using 1:3 title " inside" with lines, \
|
|
|
|
"${TMPFILE}" using 1:4 title "ambient" with lines
|
|
|
|
__EOC__
|
|
|
|
|
|
|
|
display ${IMAGE} &
|
|
|
|
\end{verbatim}
|
|
|
|
|
2021-06-27 04:32:47 +02:00
|
|
|
% -------------------------------------------------------------------
|
|
|
|
|
|
|
|
\section{Questions}
|
|
|
|
|
|
|
|
Supposons que nous ayons sous le coude un fichier contenant
|
|
|
|
\emph{six cent mille} lignes de données, qui ne représentent que
|
|
|
|
trente secondes d'enregistrement d'une valeur de Virgo\index{Virgo},
|
|
|
|
comment faire pour plotter les échantillons $N$ à $N+42$ ?
|
|
|
|
|
|
|
|
|
|
|
|
% -------------------------------------------------------------------
|
2020-09-29 10:41:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|