plotContour

Purpose

Graphs a matrix of contour data.

Format

plotContour([myPlot, ]x, y, z)
Parameters:
  • myPlot (struct) – Optional argument, a plotControl structure

  • x (1xK vector) – the x-axis data.

  • y (Nx1 vector) – the y-axis data.

  • z (NxK matrix) – the matrix of height data to be plotted.

Examples

// Clear out variables in GAUSS workspace
new;

// Create contour data
x = seqa(-4, .125, 161)';
y = seqa(-8, .125, 161);
z = sin(x) .* cos(y) * .5;
z = z .* sin(x/3) .* cos(y/3);
z = z .* sin(x/5) + sin(y/2.5)/3 + sin(x/2.5)/3;

// Set up control structure with defaults
// for surface plots
struct plotControl myPlot;
myPlot = plotGetDefaults("surface");

// Set title and Z axis label
plotSetTitle(&myPlot, "Contour plot example", "Courier bold", 16, "black");
plotSetZLabel(&myPlot, "Height (m)", "Arial", 18);

// Turn off X and Y axis labels
plotSetXLabel(&myPlot, "");
plotSetYLabel(&myPlot, "");

// Set contour level colors
string rainbow = { "Red", "Orange", "Yellow", "Green", "Blue", "Purple" };
plotSetLineColor(&myPlot, rainbow);

// Draw graph using plotcontrol structure
plotContour(myPlot, x, y, z);