2 # $Id: contours.dem,v 1.13 2006/06/25 17:24:32 sfeam Exp $
8 set zlabel "Z axis" offset 1, 0
9 set view 60, 30, 0.85, 1.1
10 set title "3D gnuplot demo - contour plot"
13 pause -1 "Hit return to continue (1)"
14 set cntrparam levels 20
15 set title "3D gnuplot demo - contour plot (more contours)"
17 pause -1 "Hit return to continue (2)"
18 set cntrparam levels incr -100,10,100
19 set title "3D gnuplot demo - contour plot (every 10, starting at -100)"
21 pause -1 "Hit return to continue (3)"
22 set cntrparam levels disc -75,-50,0
23 set title "3D gnuplot demo - contour plot (at -75, -50, 0)"
25 pause -1 "Hit return to continue (4)"
26 set cntrparam levels auto 10
27 set title "3D gnuplot demo - contour plot on base grid"
30 pause -1 "Hit return to continue (5)"
31 set title "3D gnuplot demo - contour plot on surface"
34 pause -1 "Hit return to continue (6)"
35 set title "3D gnuplot demo - contour plot on both"
38 pause -1 "Hit return to continue (7)"
40 set title "3D gnuplot demo - 2 surfaces"
41 splot x**2*y**3, x**3*y**2
42 pause -1 "Hit return to continue (8)"
43 set title "3D gnuplot demo - some more interesting contours"
44 splot x*y / (x**2 + y**2 + 0.1)
45 pause -1 "Hit return to continue (9)"
46 splot [x=-3:3] [y=-3:3] sin(x) * cos(y)
47 pause -1 "Hit return to continue (10)"
50 pause -1 "Hit return to continue (11)"
53 set cntrparam levels 5
54 set title "3D gnuplot demo - low resolution (6x6)"
56 pause -1 "Hit return to continue (12)"
58 set title "3D gnuplot demo - low resolution (6x6) using bspline approx."
60 pause -1 "Hit return to continue (13)"
62 set title "3D gnuplot demo - low resolution (6x6) raise bspline order."
64 pause -1 "Hit return to continue (14)"
67 set title "3D gnuplot demo - low resolution (6x6) using linear contours."
69 pause -1 "Hit return to continue (15)"
72 set title "3D gnuplot demo - low resolution (6x6) using bspline approx."
74 pause -1 "Hit return to continue (16)"
77 set title "3D gnuplot demo - contour of Sinc function"
78 splot [-5:5.01] [-5:5.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
79 pause -1 "Hit return to continue (17)"
80 splot [-12:12.01] [-12:12.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
81 pause -1 "Hit return to continue (18)"
82 set cntrparam levels 10
86 set title "3D gnuplot demo - contour of data grid plotting"
89 pause -1 "Hit return to continue (19)"
94 splot "glass.dat" using 1
95 pause -1 "Hit return to continue (20)"
98 set title "3D gnuplot demo - 2D contour projection of last plot"
100 pause -1 "Hit return to continue (21)"
102 #From: shen@athena.cs.uga.edu (Mingzuo Shen)
103 #Subject: Rosenbrock's function: some answers and thanks
104 #Date: Wed, 23 Jun 1993 20:50:36 GMT
106 # Last night I asked for help with a contour plot for the function:
108 # (1-x)**2 + 100 * (y - x**2)**2
110 #which should have a minimum at (x=1,y=1). This is the 2D case of a more
111 #general function named after Rosenbrock (the book I am reading does not
112 #give a reference to any paper/book by this person):
114 # for even integer n,
116 # f(x) = \sum_{j=1,3,5,\ldots,n} [(1 - x_j)^2 + 100(x_{j+1} - x_j^2)^2]
118 #where x is a vector (x1, x2, ..., x_n). This function also have a minimum
119 #at (1,1,...,1), which lies at the base of a "banana-shaped valley".
120 #Here are the new commands I have tried.
125 set cntrparam levels 5
134 set title "Rosenbrock Function"
135 splot [0.9:1.1] [0.9:1.1] (1-x)**2 + 100*(y - x**2)**2
136 pause -1 "Hit Return to Continue (22)"
142 set view 20,340 #HBB: ,1,2
145 splot [-1.5:1.5] [-0.5:1.5] (1-x)**2 + 100*(y - x**2)**2
146 pause -1 "Hit Return to Continue (23)"
153 pause -1 "Hit Return to Continue (24)"
155 set title "All contours drawn in a single color"
157 splot [-1.5:1.5] [-0.5:1.5] (1-x)**2 + 100*(y - x**2)**2 with lines lc rgb "#007700"
158 pause -1 "Hit Return to Continue (25)"