next up previous index
Next: Octave Up: Drawing Graphs Previous: Drawing Graphs   Index

Click for printer friendely version of this HowTo

GNUPlot

Here's how the 3-D graph used to illustrate Lagrange multipliers (see Figure 3.11.1 on page [*]) was created:

gnuplot> set term postscript color
gnuplot> set output "graph3d.eps"
gnuplot> set hidden3d
gnuplot> set contour
gnuplot> splot [-10:10][-10:10][-200:200]\                              
> -(x**2 + y**2)-10, x**2 + y**3

The first command, set term, sets the output to be a postscript file (with color). The second command sets the name of the file. set hidden3d tells gnuplot to let surfaces in the foreground block the visibility of those that are behind them. To turn this option off, and return to a simply wire frame rendering of your graphs, use the command set nohidden3d. set contour tells gnuplot to draw the contour lines on the plane beneath the graphs. The final command creates the graph. If you leave off the first two commands, gnuplot will draw the graph to a new window instead of writing it to a file.



Frank Starmer 2004-05-19
>