GSL shell offers a contour plot function to draw contour curves of bidimensional functions. The current algorithm works correctly only for continuous functions and it may give bad results if the function has discontinuities.
Here is an example of its utilization to plot the function \(f(x,y) = x^2 - y^2\):
contour.plot(function(x,y) return x^2 - y^2 end, -8, -8, 8, 8)
Plot a contour plot of the function f in the rectangle delimited by (xmin, ymin), (xmax, ymax) and return the plot itself.
The options argument is an optional table that can contain the following fields:
Plot a contour plot of the function f(x, y) over the circular domain of radius R and centered at the origin. The options table accepts the same fields as the function contour().
Example:
use 'math'
p = contour.polar_plot(function(x,y) return cos(x)+cos(y)+0.1*x+0.3*y end, 8)
p.title = 'cos(x) + cos(y) + 0.1*x + 0.3*y'