3.3.2.33.3 Options for PlotLayer_Options_for_Plot
-b
Syntax: layer -b parameter value [value2 value3]
Special plotting parameters: exchange X/Y axes, stack plots, draw axes/grid lines on top of data, clip data, show frame, parallel plot. Flag the given parameter as on or off for the active layer or toggle its state. value2 and value3 are only available for the s parameter. The possible parameters are:
a = draw Axes on Top of Data. value1 = 1 draws Axes on Top of (after) Data; value1 = 0 draws Data after (on Top of) Axes; value1 = -1 toggles state.
|
b = draw the plot in Scroll mode (=1) or Sweep mode (=2). Also, see Plot -a command. See the sample in this topic to demonstrate these graph drawing modes. See Example-6 in this topic.
|
c = Clip Data to Frame. value1 = 1 turns on Clip Data to Frame; value1 = 0 turns it off. value1 = -1 toggles state.
|
f = Show the frame. value1 = 1 turns on the Layer Frame; value1 = 0 turns it off. value1 = -1 toggles state.
|
g = draw Grid on Top of Data. value1 = 1 show Grid lines in front of Data; value1 = 0 show Grid lines behind Data. value1 = -1 toggles state.
|
polar = Polar Plot Y axis Range. value1 of 0 fixes Y 'From' value at zero. value1 of 1 uses Y display range.
|
pp = switch between Line Series plot and Parallel plot. value of 0 will convert parallel plot to line series plot. value of 1 will covert line series plot to parallel plot.
|
pr = Polar Plot Orientation. value1 of 0 places 0 angle radius pointing right and angles increment Counter Clockwise. value1 of 1 places 0 angle pointing up and angles increment Clockwise.
|
s = stack data plots. When parameter is s, the value can be -2, 0, 1, 2, 3, and 4. For -2, enable stacking and the stack state is set to Individual by default. Set Gap Percent to value2 and Keep Proportion of Plot Range to value3 (can further set the Multiplier by set command if needed). For 0, set stack offset of plots to None. For 1, set stack offset of plots to Cumulative. For 2, set stack offset of plots to Constant of value2. For 3, set stack offset of plots to Auto, and Gap Percent to value2 (can be NANUM if need to skip) and Keep Proportion of Plot Range to value3. For 4, set stack offset of plots to Individual. value2 and value3 for X Individual and Y Individual respectively, can be 1 = on, or 0 = off.
|
x = exchange X and Y axes.lay -b x 1;
|
Example: The following script demonstrates the plotting animation in both Scroll and Sweep modes specified by Layer -b b command
// BEGIN DEMO FOR SCROLL AND SWEEP MODES
// New project
doc -s;
doc -n;
// Add XYXY columns
wo -a 4;
wo -t 3 4;
wo -t 5 4;
// Remember book name
%Z = %H;
// Open a plot window
win -t plot;
// Include three XY pairs (Red, Green & Blue)
layer -i %Z_B;
set %Z_B -c 2;
layer -i %Z_D;
set %Z_D -c 3;
layer -i %Z_F;
set %Z_F -c 4;
// Setup the scale
x1 = 0;
x2 = 50;
y1 = -2.5;
y2 = 12.5;
delay = 0.03;
type -b Demonstrate Scroll mode;
layer -b b 1; // Set layer to Scroll model
j=1;
k=1;
l=1;
angle = 0;
repeat 200 {
plot -a %Z 1 $(j) $(sin(pi*angle/180));
j+=1;
plot -a %Z 3 $(k) $(2+2*cos(4*pi*angle/180));
k+=1;
plot -a %Z 5 $(l) $(8-2*sin(pi*angle/180)-2*cos(3*pi*angle/180));
l+=1;
second -p delay;
angle += 5;
};
type -b Now demonstrate Sweep mode;
angle = 0;
layer -b b 2; //Set layer to Sweep mode
repeat 200 {
plot -a %Z 1 $(j) $(sin(pi*angle/180));
j+=1;
plot -a %Z 3 $(k) $(2+2*cos(4*pi*angle/180));
k+=1;
plot -a %Z 5 $(l) $(8-2*sin(pi*angle/180)-2*cos(3*pi*angle/180));
l+=1;
second -p delay;
angle += 5;
};
type -b End of demonstration;
// END DEMO
-c
Syntax: layer -c
Count datasets plotted in the active layer. Put the result into the count variable, and concatenate the names of all datasets into %Z string register.
-cx
Syntax: layer -cx dataset plotIndex
Change the plot's X data to the specified dataset.
-cxy
Syntax: layer -cxy bookSheet plotIndex
Change the plot's X and Y data to the datasets in the specified sheet.
-cy
Syntax: layer -cy dataset plotIndex
Change the plot's Y data to the specified dataset.
-e
Syntax: layer -e dataset
Remove a dataset from the active layer but do not remove the data plot style holder. You can also use this command option to remove multiple datasets from the layer. One way to do this is to list the datasets after the -e option. For example, the following command removes book1_b and book1_c from the layer:
layer -e book1_b book1_c;
You can also specify a string variable that holds the names of the datasets you want to remove.
The following script performs the same action as the previous example:
%Z = "book1_b book1_c";
layer -e %Z;
Furthermore, because the -c option puts the names of the datasets in the active layer into the %Z register, the following script removes all the datasets from the layer:
layer -c;
layer -e %Z;
-g
Syntax: layer -g [BeginIndex EndIndex];
Group datasets from BeginIndex to EndIndex. If no begin and end indexes are specified, it will group all datasets in the active layer.
-gu
Syntax: layer -gu [PlotIndex]
Upgroup the grouped datasets in the active layer.
-hp
Syntax: layer -hp value PlotIndex
Hide or Show the data plot(s) in the active layer. If value = 1, hide the data plot(s). If value = 0, show the data plot(s). PlotIndex is used to specify the index (start from one) of which data plot to hide or show. If PlotIndex is ignored, all data plots in the active layer will be hidden or shown.
-i
Syntax: layer -i
Delete all data plot style holders in the active graph window layer. Resave the graph window as a template to update the template settings.
-i dataset
Syntax: layer -i dataset
Add a dataset to the active layer. Include dataset in the active layer, that is, add dataset to the Layer Contents list in the Layer n dialog box. This is the standard method for plotting a dataset. If dataset is omitted, this command removes all the data plot style templates within the layer. You can also use this command option to add multiple datasets to the layer. One way to do this is to list the datasets after the -i option. For example, the following command adds book1_b and book1_c to the layer:
layer -i book1_b book1_c;
You can also specify a string variable that holds the names of the datasets you want to add. Thus, the following script performs the same action as the previous example:
%Z = "book1_b book1_c";
layer -i %Z;
Even you can specify a subrange for the dataset. The following script plots data in row 5 to 10 of column B.
range rr = col(B)[5:10];
win -t plot;
layer -i rr;
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
}
-i#
Syntax: layer -i# dataset
Replot into the plot type specified by #. Here, # is a number to indicate the plot type, and there is no SPACE between the -i and the number. The graph types and numbers are used as in worksheet -p command. See the list of graph types and their numbers (IDs).
If dataset is omitted, this command removes all the data plot style templates within the layer.
-ic
Syntax: layer -ic sourceGraph sourceLayerNumber
layer -ic graph2 2; //copy graph2 to layer2 of graph1
Copy all data plots from the specified layer number of the specified graph window into the active graph layer.
-ie
Syntax: layer -ie
Delete all data plot style holders that are not in use in the active graph window layer. Resave the graph window as a template to update the template settings.
To find out which style holders are in use, use list o;. This command returns three attributes of the objects (including data plot style holders) in the active graph window
layer: index type* name.
Type = 7 indicates a data plot style holder. The asterisk(*) indicates the style holder is in use.
-il
Syntax: layer -il dataSetName
Add label text to an existing unlabeled dataplot by specifying its name. By default, the y-value for each datapoint is used as the label text, and each datapoint is labeled. Custom label text cannot be specified with this option. Related switches are:
Switch
|
Action
|
ilr
|
Use row-index as label text
|
ilx
|
Use x-value as label text
|
ily
|
Same as -il
|
ilxy
|
Use (x,y) values as label text
|
-ip
Syntax: layer -ip dataset
This switch is similar to the -i switch, except that if the added dataset is already in the active layer, the -i switch will not add this dataset to the active layer anymore, but the -ip switch will still add it to the active layer. For example:
range aa = [mbook2]1!1;
range bb = [mbook2]1!2;
layer -ip aa bb;
-iu
Syntax: layer -iu
Delete all data plot style holders that are in use in the active graph window layer. Resave the graph window as a template to update the template settings. See the -ie option for more information.
-j
Syntax: layer -j
Extract multiple data plots in a single layer into a multiple panel (layer) graph in which each data plot displays in its own layer.
-r
Syntax: layer -r
Reverse the order of the data plots in the active layer.
-t nrow
Syntax: layer -t [nrow]
Used with nrow, the -t option sets the worksheet row that provides the axis title and the legend text for the active dataplot. The X cell value provides the X axis title. The Y cell value provides the legend text.
Used by itself, the -t option clears the effect of the -t nrow option.
|