plotSetActiveY#

Purpose#

Configures the y-axis to apply attribute changes to when supported plotSet functions are used. This function only affects the behavior of future plotSet calls, and will not retroactively change axis attributes that were set prior to this call.

Format#

plotSetActiveY(&myPlot, axis)#
Parameters:
  • &myPlot (struct pointer) – A plotControl structure pointer.

  • axis (string) –

    The axis to set as “active”. Supported options:

    left (default)

    right

    both

Examples#

Set attributes for right y-axis only#

new;

// Declare plotControl structure
struct plotControl myPlot;

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

// Set grid line options specifically for the right Y Axis.
plotSetActiveY(&myPlot, "right");

// Set Y Grid Pen attributes. This will apply to the right only.
plotSetYGridPen(&myPlot, "major", 2, "blue");

// Specify that first line should be on the bottom, and second on the right.
// This setter is independent of the active y-axis.
plotSetWhichYAxis(&myPlot, "left"$|"right");

// Only the right y-axis will have a 2px thick blue grid line.
plotXY(myPlot, seqa(1,1,10), rndu(10,2));

Set attributes for both y axes simultaneously#

new;

// Declare plotControl structure
struct plotControl myPlot;

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

// Set grid line options specifically for the right Y Axis.
plotSetActiveY(&myPlot, "both");

// Set Y Grid Pen attributes. This will apply to the right only.
plotSetYGridPen(&myPlot, "major", 2, "blue");

// Specify that first line should be on the bottom, and second on the right.
// This setter is independent of the active y-axis.
plotSetWhichYAxis(&myPlot, "left"$|"right");

// Both y-left and y-right will have 2px thick blue grid lines.
plotXY(myPlot, seqa(1,1,10), rndu(10,2));

Note

This function sets an attribute in a plotControl structure. It does not affect an existing graph, or a new graph drawn using the default settings that are accessible from the Tools > Preferences > Graphics menu.