CoursInformatique/GNUplot/Test.gp

74 lines
1.6 KiB
Plaintext
Raw Normal View History

2019-12-12 22:25:13 +01:00
#définition de quelques variables
xmin=-6.
xmax=6.
ymin=-4.
ymax=4.
xdec=0.25
ydec=0.25
pasx=1.0
pasy=1.0
#initialisation du terminal
reset
set term x11
unset autoscale
set xr [xmin:xmax]
set yr [ymin:ymax]
#options
unset border
unset label
unset xtics
unset ytics
set title "fonction tangente"
#les axes
set arrow 3 from xmin,0 to xmax,0,3 lt -1 lw 0.5
set arrow 4 from 0,ymin to 0,ymax,3 lt -1 lw 0.5
#l'origine
set label "0" at xdec/2, -ydec
set label "x" at xmax - pasx, -ydec
set label "y" at -xdec, ymax - pasy/3
set label "1" at pasx, -ydec
set label "1" at -3*xdec/2, pasy
set label "-1" at -3*xdec/2, -pasy
set arrow from 1, -ydec/2 to 1, ydec/2 nohead lt -1
set arrow from 1.57, -ydec/2 to 1.57, ydec/2 nohead lt -1
set label "\34/2" at 1.57, -ydec center
set arrow from -1.57, -ydec/2 to -1.57, ydec/2 nohead lt -1
set label "-\34/2" at -1.57, -ydec center
set arrow from 3.1415, -ydec/2 to 3.1415, ydec/2 nohead lt -1
set label "\34" at 3.1415, -ydec center
set arrow from -3.1415, -ydec/2 to -3.1415, ydec/2 nohead lt -1
set label "-\34" at -3.1415, -ydec center
set arrow from 0, 0 to pasx, pasx lt 1
set arrow from 0, 0 to -pasx, -pasx lt 1
set arrow from -xdec/3, 1 to xdec/3, 1 nohead lt -1
set arrow from -xdec/3, -1 to xdec/3, -1 nohead lt -1
set arrow from -1.57, ymax to -1.57, ymin nohead lt 0
set arrow from 1.57, ymax to 1.57, ymin nohead lt 0
plot tan(x) title "tan" w l lt 3 lw 2
pause -1 "maintenant va créer un fichier au format png appuyer sur entrée"
set term png
set out "exemple2.png"
rep
set out
set term x11
pause -1 "touche entrée pour sortir"