plotSetActiveX

Purpose

Configures the x-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

plotSetActiveX(&myPlot, axis)
Parameters
  • &myPlot (struct pointer) – A plotControl structure pointer.

  • axis (string) – The axis to set as “active”. Supported options:

Examples

Set attributes for top x-axis only

new;

// Declare plotControl structure
struct plotControl myPlot;

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

// Set grid line options specifically for the top X Axis.
plotSetActiveX(&myPlot, "top");

// Set X Grid Pen attributes. This will apply to the top only.
plotSetXGridPen(&myPlot, "major", 2, "blue");

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

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

Set attributes for both x axes simultaneously

new;

// Declare plotControl structure
struct plotControl myPlot;

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

// Set grid line options specifically for the top X Axis.
plotSetActiveX(&myPlot, "both");

// Set X Grid Pen attributes. This will apply to the top only.
plotSetXGridPen(&myPlot, "major", 2, "blue");

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

// Both x-bottom and x-top 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.