Mathc matrices/a28
Préambule Modifier
Voir l'introduction du livre pour une présentation de gnuplot.
En pratique Modifier
Vous pouvez tester ces exemples en les copiant directement dans gnuplot sans passer par le fichier a_main.plt. Il suffit ensuite de taper return pour effectuer les commandes.
test Modifier
Cet exemple donne les informations de base.
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
#
test
reset
# ---------------------
Le passage à la ligne Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# \n -> \
#
plot cos(x),\
sin(x),\
.4,\
-.4
reset
# ---------------------
Chaine de caractères Modifier
linetype | lt <0..15> Modifier
Chaque nombre correspond à une couleur différente. (voir test)
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# linetype | lt <0..15>
#
plot cos(x) lt 1,\
sin(x) lt 2,\
.4 lt 3,\
-.4 lt 3
reset
# ---------------------
linewidth | lw <1.. 6> Modifier
Chaque nombre correspond à une épaisseur différente.
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# # linewidth | lw <1.. 6>
#
plot cos(x) lt 1 lw 1,\
sin(x) lt 2 lw 3,\
.4 lt 3 lw 4,\
-.4 lt 3 lw 6
reset
# ---------------------
Liste de points Modifier
plot "data" Modifier
Dessiner une liste de points.
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
#
plot "data"
reset
# ---------------------
Créer un fichier "data" avec ces données :
-5 25 -4 16 -3 9 -2 4 -1 1 0 0 1 1 2 4 3 9 4 16 5 25
pointtype | pt <0..15> Modifier
Chaque nombre correspond à un dessin différent de points. (voir test)
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# pointtype | pt <0..15>
#
plot "data" pt 10
reset
# ---------------------
pointsize | ps <1.. > Modifier
Chaque nombre correspond taille de points différents. (voir test)
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# pointsize | ps <1.. >
#
plot "data" pt 10 ps 3
reset
# ---------------------
with linesp Modifier
Les points sont réliés par des segments.
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# linetype | lt <0..15> (color)
# linewidth | lw <1.. 6> (size)
# pointsize | ps <1.. > (size)
#
plot "data" with linesp lt 3 lw 3 ps 3
reset
# ---------------------
pt 0 Modifier
Sans les points.
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# linetype | lt <0..15> (color)
# linewidth | lw <1.. 6> (size)
# pointsize | ps <1.. > (size)
#
plot "data" with linesp lt 3 lw 3 ps 3 pt 0
reset
# ---------------------
Commandes générales Modifier
set zeroaxis lt 8 lw 3 Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# linetype | lt <0..15> (color)
# linewidth | lw <1.. 6> (size)
#
set zeroaxis lt 8 lw 3
plot sin(x),\
cos(x)
reset
# ---------------------
set grid lt 8 lw 3 Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# linetype | lt <0..15> (color)
# linewidth | lw <1.. 6> (size)
# pointsize | ps <1.. > (size)
#
set grid lt 8 lw 3
plot sin(x),\
cos(x)
reset
# ---------------------
complet Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
# linetype | lt <0..15> (color)
# linewidth | lw <1.. 6> (size)
# pointsize | ps <1.. > (size)
#
set zeroaxis lt 8 lw 3
set grid
plot [-6.:6.] [-1.4:1.4]\
sin(x),\
cos(x)
reset
# ---------------------
En pratique Modifier
Les premières commandes pour dessiner des fonctions en 3d.
splot[x][y][z] (La fonction) Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
reset
splot [0:2*pi][0:2*pi][-1:1]\
cos(x)*cos(y)
# ---------------------
Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
reset
set hidden
splot [0:2*pi][0:2*pi][-1:1]\
cos(x)*cos(y)
# ---------------------
set view rot_x, rot_z, scale, scale_z (Imposer une vue) Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
reset
set hidden
set view 55.,57., 1., 1.
splot [0:2*pi][0:2*pi][-1:1]\
cos(x)*cos(y)
# ---------------------
set xlabel "X axis" (Nommer les axes) Modifier
# ---------------------
# save this file as : a_main.plt
# Then into gnuplot : load "a_main.plt"
#
reset
set hidden
set xlabel "X axis"
set ylabel "Y axis"
set view 55.,57., 1., 1.
splot [0:2*pi][0:2*pi][-1:1]\
cos(x)*cos(y)
# ---------------------