# $ID: Demo gnuplot "surfaces" # set title "DEMO GNUPLOT LINUX" set nokey set xrange [0:20] set yrange [0:10] set label 1 " ### # # #### ##### ### ### ##### ### " at 5,9 set label 2 "# # # # # # # # # # # # # #" at 5,8.8 set label 3 " ## # # # # #### # # # #### ## " at 5,8.6 set label 4 " ## # # #### # ##### # # ## " at 5,8.4 set label 5 "# # # # # # # # # # # # # #" at 5,8.2 set label 7 " ### ### # # # # # ### ##### ### " at 5,8 set label 8 "(C) Robert Billon, 1999, 2001" at 7,6 a=10000; b=200000 plot a*x replot -a*x+b replot 10 replot 7 replot 5 replot 0 set nolabel pause 5 # # Fonction de Rosenbrock # set auto set surface set nokey set nocontour set cntrparam levels 5 set cntrparam linear set samples 100 set logscale z set hidden3d set isosamples 36 set view 70,360,1 set xlabel "x" set ylabel "y" set label "z = (1-x)^2 + A * (y - x^2)^2" at 1,1,500 set title "FONCTION DE ROSENBROCK",+5 splot [0.9:1.1] [0.9:1.1] (1-x)**2 + 100*(y - x**2)**2 pause 2 clear set view 70,335 replot (1-x)**2 + 100*(y - x**2)**2 pause 2 clear set view 70, 310 replot (1-x)**2 + 100*(y - x**2)**2 set nolabel pause 2 # set isosamples 60 set view 20,360,1,2 set xlabel "x" set ylabel "y" set label "z = (1-x)^2 + A * (y - x^2)^2" at 1.2,1,100000 splot [-1.5:1.5] [-0.5:1.5] (1-x)**2 + 100*(y - x**2)**2 pause 2 set view 20,340,1,0.6 replot (1-x)**2 + 100*(y - x**2)**2 pause 2 set view 20,320,1,1 replot (1-x)**2 + 100*(y - x**2)**2 pause 2 # # Clean up: # set nolog set surface set nocontour set cntrparam levels 5 set cntrparam linear set samples 100 set isosamples 10 set view 60,30,1,1 set xrange [-10:10] set yrange [-10:10] set zrange [-10:10] set auto set title "" 0,0 set xlabel "" 0,0 set ylabel "" 0,0 set zlabel "" 0,0 set nolabel # set samples 30 set isosamples 30 set hidden3d set title "z = 1 / x^2 + y^2 + 1",+5 set nokey set xlabel "x" set ylabel "y" set zlabel "z" set xrange [-3:3] set yrange [-2:2] set view 70,310 splot 1 / (x*x + y*y + 1) #set nolabel 1 #set nolabel 2 pause 2 set title "z = 1 / x^2 + y^2 + 10",+5 splot 1 / (x*x + y*y + 10) pause 2 set title "z = x * y / x^2 + y^2 + 0.1",+5 set view 70,45 set isosamples 40 set xrange [-1:1] set yrange [-1:1] splot x*y / (x**2 + y**2 + 0.1) pause 2 set view 40,135 replot x*y / (x**2 + y**2 + 0.1) pause 2 set view 130,40 replot x*y / (x**2 + y**2 + 0.1) pause 2 set title "z = sin(x^2 + y^2) / (x^2 + y^2)",+5 set hidden3d set isosamples 60 set view 42,40 set nocontour set xrange [-3:3] set yrange [-3:3] splot sin(x*x + y*y) / (x*x + y*y) pause 2 set view 110,45 replot sin(x*x + y*y) / (x*x + y*y) pause 2 set title "z = sin(x) * cos(y),+5 set view 60,30 set xrange [-3:3] set yrange [-3:3] splot sin(x) * cos(y) pause 2 set view 75,230 #set contour replot pause 2 # set noautoscale set samples 30 set isosamples 80 set hidden3d set title "z = 2 * cos(r(x,y)) + 1, avec r(x,y) = 2 * sqrt((x-1)^2 + (y-1)^2) + 2",+5 set nokey set xlabel "x" set ylabel "y" set zlabel "z" set xrange [0:10] set yrange [0:10] set zrange [-1:10] set view 70,310 r(x,y)=2*sqrt((x-1)**2+(y-1)**2)+2 splot 2*cos(r(x,y))+1 pause 2 set view 50,190 #r(x,y)=2*sqrt((x-1)**2+(y-1)**2)+2 replot 2*cos(r(x,y))+1 pause 2 set noautoscale set samples 30 set isosamples 80 set hidden3d set title "z = 25 * sin((x-0.2)/0.1) * sin((y-0.2)/0.1) + 45",+5 set nokey set xlabel "x" set ylabel "y" set zlabel "z" set xrange [0:200] set yrange [0:200] set zrange [0:100] set view 70,310 splot 25*sin((x-0.2)/0.1)*sin((y-0.2)/0.1)+45 pause 2 set view 45,160 splot 25*sin((x-0.2)/0.1)*sin((y-0.2)/0.1)+45 pause 2 # set noautoscale set samples 30 set isosamples 80 set hidden3d set title "z = 100/(1+sqrt(sin(0.05 * (x-0.15))^2 * sin(0.05 * (y-0.15))^2))",+5 set nokey set xlabel "x" set ylabel "y" set zlabel "z" set xrange [0:200] set yrange [0:200] set zrange [40:120] set view 45,160 u(x,y)=105/(1+sqrt(sin(0.05*(x-0.15))**2*sin(0.05*(y-0.15))**2)) splot u(x,y) pause 2 set view 100, 160 #set view 120,310 splot u(x,y) pause 2 # # clean up # set nolabel set xrange [-10:10] set yrange [-10:10] set zrange [-10:10] set nocontour set nogrid set nohidden3d set samples 100 set isosamples 10 set view 60,30,1,1 set auto set title "" 0,0 reset