Options for Graph

 

no option

Set layer width, height, and horizontal and vertical position on the page. Width, height, xOffset, and yOffset specify layer width, height, and horizontal and vertical position on the page (measured in the current units, from the top left corner of the page to the top left corner of the layer), respectively. A zero value for width or height retains the current setting. A single zero argument (layer 0) fits the active layer to the page. If no arguments are issued, the Select Columns for Plotting dialog box opens.

Example:

sets xOffset and yOffset to 45. It retains the current values for width and height.

lay 0 0 45 45;

Given three layers, the following script sizes each layer to 20% of the page width and 80% of the page height. It arranges the layers 10% from the top of the page, starting at 8% in from the left, and separated by 12% of the full page.

width = 20;
height = 80;
for (ii = 1; ii <= 3; ii++) 
      {
            layer -s ii;
            layer width height (8+(ii-1)*(width+12)) 10;
      };

-a

Syntax: layer -a

Rescale the X and Y axes of the active layer to show all the data plotted in that layer. The range of the X axis includes the rescale margin and begins and ends on the nearest major or minor tick. To rescale only the X or Y axis, set the other axis as fixed (for example, using layer.axis.rescale = 1 ). You can then save the graph window as a template.

Example: The following script creates a new graph window, adds data to the layer, and then creates a second graph window and adds data to that layer.

%A = data1;  //assign worksheet name to %A
loop (ii, 2, 3) 
      {   
            win -t plot line;  //open graph from line template
            %B = data1!wks.col$(ii).name$;  //assign column name to %B
            layer -i %A_%B;  //add data to layer
            layer -a;  //rescale axes to show all data
      }
Note:

Variations of the -a option are supported, and can be specified using the following scale identifiers:
x = x scale
y = y scale
z = z scale
m = color map
u = enables undo actions from the GUI Edit menu
e = reference line

  • By combining one or more of these scale identifiers, you control which are rescaled on data change. Rescaling is applied to those which are NOT listed E.g.
    • layer -azm will trigger rescale of XY only. Z axis and colormap will not be rescaled.
    • layer -aryzm will trigger rescale of the x axis only. Y and Z axes and colormap will not be rescaled.
    • layer -arxzm will trigger rescale of the y axis only. X and Z axes and colormap will not be rescaled.
    • layer -arxzme will trigger rescale of the y axis only, including y axis reference line.
  • By adding a -u option in combination with other options, you enable undo actions from the Edit menu (e.g. layer -axyz u; will allow an Edit menu undo of a colormap rescale).

-a ma

Syntax: layer -a ma

Rescale the X and Y axes of all linked layers in one family together to show all the data. Note: layer -a is only used to rescale the current layer; layer -a ma is used to rescale all linked layers in current graph window.

-at

Syntax: layer -at

Rescale the X and Y axes of the active layer to show all the data plotted in that layer, but ignore tick settings.The range of the X axis will be the data range plus the rescale margin.

-b 3DB

Syntax: layer -b 3DB value

Set graph display caching to none, raster, or vector. Value = 0 for no caching. Value = 1 for raster caching. Value = 2 for vector caching.

-cm l

Syntax: layer -cm l[r|p] fileName [index|name]

Load a saved color map. The optional r switch converts a palette index to RGB values. The optional p switch converts RGB values to a palette index. If the layer contains multiple data plots, use index or name to specify a data plot other than the active data plot. The string notation %(index, @D) returns the name of the index'th data plot.

-cm s

Syntax: layer -cm s[r|p] fileName [index|name]

Save a color map. The optional r switch converts a palette index to RGB values. The optional p switch converts RGB values to a palette index. If the layer contains multiple data plots, use index or name to specify a data plot other than the active data plot. The string notation %(index, @D) returns the name of the index'th data plot.

-k

Syntax: layer -k value

Open the Plot Details or Layer n dialog box, depending upon the value specified. If value = p, open the Plot Details dialog box for the active layer. If value = c, open the Layer n dialog box for the active layer. If value = d, open the Link Axes Scales tab of the Plot Details dialog box for the active layer. (Note: The active layer must be a linked layer to open this dialog box.)

-n

Syntax: layer -n

Add a nonlinked layer to the active graph window displaying a bottom X and left Y axis.

-n Both

Syntax: layer -n Both

Add a linked layer to the active graph window displaying a top X and right Y axis.

-n X

Syntax: layer -n X

Add a linked layer to the active graph window displaying a top X axis.

-n Y

Syntax: layer -n Y

Add a linked layer to the active graph window displaying a right Y axis.

-p

Syntax: layer -p axisScale

Apply the X or Y scale of the active layer to all other layers in the active window. Set axisScale to X to apply the X scale, or to Y to apply the Y scale.

-u

Syntax: layer -u unit

Change the units in which layer size and position are measured. Unit# specifies the type of units in the order listed on the Size/Speed tab of the layer's Plot Details dialog box. 1 = % of page, 2 = inch, 3 = centimeters, etc.

Example:

lay -u 5;//changes the units to pixels.

-x

Syntax: layer -x

Get the layer frame dimensions into variables v1 (width), v2 (height), v3 (left), and v4 (top).The values are in the current unit for the layer. To set the layer frame size, use the layer command without an option switch.