<html>
<head>
<title>Gnuplot batch file for 3-D surface data</title>
</head>

<h2>Gnuplot batch file for 3-D surface data</h2>

<body>
<hr>

<a href="opt.zip">Download the dataset and other files</a><p>

<pre>
# 	Bob Gotwals
#	June 22,2003
#	optimize.txt
# 	This batch file does a plot of 3-D surface data
#
#	About this dataset
#	this dataset represents a chemical reaction.
#	We have two chemicals, A and B
#	When we mix these two chemicals, we get a new product, C
#	We want to see how combinations of A and B influence the product of C
# 	Both A and B go from 0 to 64 in increments of 2 (0,2,4,6,...64)
#
reset				#	it's always the first command!
set data style points		# 	turn on points as the default style
set title "Optimization of Chemical Reactions\n3850-B^2+100A-A^2+60B+0.1AB"	
set xrange[0:64]
set yrange[0:64]
set xtics 0,8,64
set ytics 0,8,64
set grid
set ticslevel 0			#  	puts the Z-axis marks at 0 (the origin)
set xlabel "Chemical A"		#	sets the x label title
set ylabel "Chemical B"		#	sets the y label title
#
# Print the first visualization
#
splot "optimize.dat" title "Chemical C"	#	does a surface plot of the dataset
pause -1 "Press return for next view"	#	waits for the user to hit a return
set dgrid3d 10,10,1		#this command maps the data to a 10x10 grid
replot				#	replot is your friend
#
# Print the second visualization
#							
pause -1 "Press return to go to the next view"
set ticslevel 0.5		#	moves the plot up a bit
set data style lines		#	changes the style to lines, not points
set dgrid3d	25,25,16	#this command maps the data to a 25x25 grid with 16x weighting
replot
#
# Print the third visualization
#	
pause -1 "Press return to go to the next view"
set nokey			#	turn off the legend key
set nogrid
set contour both		#	sets up a contour plot on the base
set cntrparam levels incremental 3500,250,7500	# plots the contour every 0.5 units
replot
#
# Print the fourth visualization
#	
pause -1 "Press return to go to the next view"
set view 0,0			#  looks at the plot from a top view
replot
#
# Print the fifth visualization
#	
pause -1 "Press return to go to the next view"
set view 60,30			#  sets the view back to 60,30 (the default)
replot
#
# Print the sixth visualization (a movie)
#	
pause -1 "Press return to go to the next view"
zrot=0
xrot=0
iteration_count=0
limit_iterations=10
load 'gnuplot.rot'		#  a batch file to rotate the image
replot
</pre>

</body>
</html>
