Useful Octave Functions

Gcontour

Gcontour

You need the following files to properly use the gcontour function:

This function produces two-dimensional contour plots. And this function can generate different colors for different contour levels. For more detailed inctructions, please refer to the documentation.

Example 1

In Octave:

x = (-10:1:10)';
y = x';
z = x*y;
__gnuplot_raw__ ("set title 'Gcontour'\n");
gcontour (x, y, z, "-@(2|3|default|6|1);x*y;");

The output will be:

Example 2

In Octave:

x = (-10:1:10)';
y = x';
z = x*y;
w = sin(x)*sin(y);
__gnuplot_raw__ ("set title 'Gcontour 2'\n");
gcontour (x, y, z, 10, "-@(2|1|default|2|0.5);x*y;", x, y, w, 5, "-@(3|1|default|6|0.5);sin(x)*sin(y);");

The output will be:

©2007 Francis Poulin