plotSetGrid

Purpose

Controls the settings for the background grid of a plot.

Format

plotSetGrid(&myPlot, tickStyle[, color])
plotSetGrid(&myPlot, onOff)
Parameters:
  • &myPlot (struct pointer) – A plotControl structure pointer.
  • tickStyle (string) – specifies whether grid marks should be drawn on major tick marks. Options: "major"
  • color (string) – Optional argument, name or rgb value of the new color.
  • onOff (string) – turns the grid on or off. Options: "on" or "off". If used, this must be the only argument passed to the function besides the plotControl structure pointer.

Examples

// Declare plotControl structure
struct plotControl myPlot;

// Initialize plotControl structure
myPlot = plotGetDefaults("scatter");

// Set grid to be black and on the major ticks only
plotSetGrid(&myPlot, "major", "black");

// Create a scatter plot of random data
plotScatter(myPlot, seqa(1, 1, 10 ), rndn(10, 1));

// Turn off the grid
plotSetGrid(&myPlot, "off");

See also

Functions plotCustomLayout(), plotSetTitle()