Mathc initiation/Fichiers h : c49bb
En pratique
modifierVous pouvez tester ces exemples en les copiant directement dans gnuplot. Il suffit ensuite de taper return pour effectuer les commandes.
test
modifierCet exemple donne les informations de base.
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
test
reset
# ---------------------
Le passage à la ligne
modifier# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# \n -> \
#
plot cos(x),\
sin(x),\
.4,\
-.4
reset
# ---------------------
Chaine de caractères
modifierlinetype | lt <0..15>
modifierChaque nombre correspond à une couleur différente. (voir test)
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# linetype | lt <0..15>
#
plot cos(x) lt 1,\
sin(x) lt 2,\
.4 lt 3,\
-.4 lt 3
reset
# ---------------------
linewidth | lw <1.. 6>
modifierChaque nombre correspond à une épaisseur différente.
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# # 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
modifierplot "data"
modifierDessiner une liste de points.
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
#
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>
modifierChaque nombre correspond à un dessin différent de points. (voir test)
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# pointtype | pt <0..15>
#
plot "data" pt 10
reset
# ---------------------
pointsize | ps <1.. >
modifierChaque nombre correspond à une taille de points différents. (voir test)
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# pointsize | ps <1.. >
#
plot "data" pt 10 ps 3
reset
# ---------------------
with linesp
modifierLes points sont réliés par des segments.
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# 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
modifierSans les points.
# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# 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
modifierset zeroaxis lt 8 lw 3
modifier# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# 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# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# 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
# ---------------------
Pour éviter la déformation du graphe :
set size ratio -1
# ---------------------
# Copy and past this file into the screen of gnuplot
#
# linetype | lt <0..8> (color)
# linewidth | lw <1..6> (size)
#
set size ratio -1
plot [-5.:5] [-1:1]\
cos(x) lt 8 lw 6,\
sin(x) lt 7 lw 6
reset
# ---------------------
complet
modifier# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
# 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
modifierLes premières commandes pour dessiner des fonctions en 3d.
splot[x][y][z] (La fonction)
modifier# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
reset
splot [0:2*pi][0:2*pi][-1:1]\
cos(x)*cos(y)
# ---------------------
set hidden (Faces cachées)
modifier# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
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# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
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# ---------------------
# Copy and past this file into the screen of gnuplot
#
#
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)
# ---------------------