Annotation of OpenXM_contrib/gnuplot/demo/contours.dem, Revision 1.1.1.3
1.1 maekawa 1: #
1.1.1.3 ! ohara 2: # $Id: contours.dem,v 1.2.2.4 2001/12/04 14:12:53 lhecking Exp $
1.1 maekawa 3: #
4: set samples 20
5: set isosamples 21
6: set xlabel "X axis" -5,-2
7: set ylabel "Y axis" 4,-1
8: set zlabel "Z axis"
9: set title "3D gnuplot demo - contour plot"
10: set contour
11: splot x*y
12: pause -1 "Hit return to continue (1)"
13: set cntrparam levels 20
14: set title "3D gnuplot demo - contour plot (more contours)"
15: replot
16: pause -1 "Hit return to continue (2)"
17: set cntrparam levels incr -100,10,100
18: set title "3D gnuplot demo - contour plot (every 10, starting at -100)"
19: replot
20: pause -1 "Hit return to continue (3)"
21: set cntrparam levels disc -75,-50,0
22: set title "3D gnuplot demo - contour plot (at -75, -50, 0)"
23: replot
24: pause -1 "Hit return to continue (4)"
25: set cntrparam levels auto 10
26: set title "3D gnuplot demo - contour plot on base grid"
27: set contour base
28: splot x**2-y**2
29: pause -1 "Hit return to continue (5)"
30: set title "3D gnuplot demo - contour plot on surface"
31: set contour surface
32: replot
33: pause -1 "Hit return to continue (6)"
34: set title "3D gnuplot demo - contour plot on both"
35: set contour both
36: replot
37: pause -1 "Hit return to continue (7)"
38: set contour base
1.1.1.3 ! ohara 39: set title "3D gnuplot demo - 2 surfaces"
1.1 maekawa 40: splot x**2*y**3, x**3*y**2
41: pause -1 "Hit return to continue (8)"
42: set title "3D gnuplot demo - some more interesting contours"
43: splot x*y / (x**2 + y**2 + 0.1)
44: pause -1 "Hit return to continue (9)"
45: splot [x=-3:3] [y=-3:3] sin(x) * cos(y)
46: pause -1 "Hit return to continue (10)"
1.1.1.3 ! ohara 47: set zrange [-1.0:1.0]
1.1 maekawa 48: replot
49: pause -1 "Hit return to continue (11)"
50: set samples 6
51: set isosamples 6
52: set cntrparam levels 5
53: set title "3D gnuplot demo - low resolution (6x6)"
54: replot
55: pause -1 "Hit return to continue (12)"
56: set cntrparam bspline
57: set title "3D gnuplot demo - low resolution (6x6) using bspline approx."
58: replot
59: pause -1 "Hit return to continue (13)"
60: set cntrparam order 8
61: set title "3D gnuplot demo - low resolution (6x6) raise bspline order."
62: replot
63: pause -1 "Hit return to continue (14)"
64: set cntrparam linear
65: set auto
66: set title "3D gnuplot demo - low resolution (6x6) using linear contours."
67: splot x*y
68: pause -1 "Hit return to continue (15)"
69: set cntrparam order 4
70: set cntrparam bspline
71: set title "3D gnuplot demo - low resolution (6x6) using bspline approx."
72: replot
73: pause -1 "Hit return to continue (16)"
74: set samples 25
75: set isosamples 26
76: set title "3D gnuplot demo - contour of Sinc function"
77: splot [-5:5.01] [-5:5.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
78: pause -1 "Hit return to continue (17)"
79: splot [-12:12.01] [-12:12.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2)
80: pause -1 "Hit return to continue (18)"
81: set cntrparam levels 10
82: set xrange [0:15]
83: set yrange [0:15]
84: set auto
1.1.1.3 ! ohara 85: set zrange [-1.0:1.0]
1.1 maekawa 86: set data style lines
87: set title "3D gnuplot demo - contour of data grid plotting"
88: set parametric
89: splot "glass.dat"
90: pause -1 "Hit return to continue (19)"
91: set zrange [-1.2:1.2]
92: set noparametric
93: splot "glass.dat" using 1
94: pause -1 "Hit return to continue (20)"
95: set view 0,0,1
96: set nosurface
97: set title "3D gnuplot demo - 2D contour projection of last plot"
98: replot
99: pause -1 "Hit return to continue (21)"
100:
101: #From: shen@athena.cs.uga.edu (Mingzuo Shen)
102: #Subject: Rosenbrock's function: some answers and thanks
103: #Date: Wed, 23 Jun 1993 20:50:36 GMT
104: #
105: # Last night I asked for help with a contour plot for the function:
106: #
107: # (1-x)**2 + 100 * (y - x**2)**2
108: #
109: #which should have a minimum at (x=1,y=1). This is the 2D case of a more
110: #general function named after Rosenbrock (the book I am reading does not
111: #give a reference to any paper/book by this person):
112: #
113: # for even integer n,
114: #
115: # f(x) = \sum_{j=1,3,5,\ldots,n} [(1 - x_j)^2 + 100(x_{j+1} - x_j^2)^2]
116: #
117: #where x is a vector (x1, x2, ..., x_n). This function also have a minimum
118: #at (1,1,...,1), which lies at the base of a "banana-shaped valley".
119: #Here are the new commands I have tried.
120: #
121: set auto
122: set surface
123: set nocontour
124: set cntrparam levels 5
125: set cntrparam linear
126: set samples 100
127: set logscale z
128: set hidden3d
129: set isosamples 20
130: set view 70,335,1
131: set xlabel "x"
132: set ylabel "y"
133: set title "Rosenbrock Function"
134: splot [0.9:1.1] [0.9:1.1] (1-x)**2 + 100*(y - x**2)**2
135: pause -1 "Hit Return to Continue (22)"
136:
137: set logscale z
138: set hidden3d
139: set isosamples 60
1.1.1.2 maekawa 140: set ticslevel 0.
141: set view 20,340 #HBB: ,1,2
1.1 maekawa 142: set xlabel "x"
143: set ylabel "y"
144: splot [-1.5:1.5] [-0.5:1.5] (1-x)**2 + 100*(y - x**2)**2
145: pause -1 "Hit Return to Continue (23)"
146: set contour
147: set nosurface
148: replot
149: pause -1 "Hit Return to Continue (24)"
150: #
151: # Clean up:
152: #
1.1.1.3 ! ohara 153: reset
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>