Use plot_group instead
1. plotgroup iy:=[Book1]Sheet1!Col(2) pgrp:=[Book1]Sheet1!Col(3); //Use col(3) in Book3, sheet1 as grouping column, plot col(2) of each group into different graph windows
2. plotgroup iy:=(A,B) dgrp:=C type:=linesymb; //Using column C as grouping info., plot A(x), B(y) as line+symbol plots, each group will be an individual plot
This feature is updated in 9.0 to add an option to hide output graphs.
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | iy |
Input XYRange |
|
The input XYRange data to plot by group. This is the data which actually gets plotted. |
Column for Page Group | pgrp |
Input Column |
|
This Column data will be used for page groups. When data in this column changes, a new Graph window is created. |
Column for Layer Group | lgrp |
Input Column |
|
This Column data will be used for layer groups. When data in this column changes, a new Graph Layer is added to the current Graph window. |
Column for Data Group | dgrp |
Input Column |
|
This Column data will be used for data groups. When data in this column changes, a new Data group is added to the current Layer of the current Graph window. |
Arrangment of Layers | arrange |
Input int |
|
Layers will be arranged vertically or horizontally in Page.
Option list:
|
Graph Template | template |
Input string |
|
Specify the template used to plot the graph layers. |
Plot Type | type |
Input int |
|
Specify the plot type to plot the graphs.
Option list:
|
Sort Worksheet by Groups Data | sort |
Input int |
|
Specify whether to sort the worksheet according to the groups. The sort sequence is Primary : Page Group, Secondary : Layer Group, Tertiary : Data Group. The worksheet is left in this sorted order after plotting. If you need the original sort order, you should work with a copy of your worksheet.
Option list:
|
Hide Newly Created Graph | hide |
Input int |
|
Specify whether to hide newly created graph(s) (1) or not (0). |
The function can be used to plot by column data for page group, for layer group, and for data group.
This example shows how to import data, sort it by group column and then plot by group column.
// Get the sample data fn$ = system.path.program$ + "Samples\Statistics\body.dat"; newbook; impASC fn$; // Sort worksheet - sorting is very important wsort bycol:=3; // Plot data of different sex into diferent graph windows plotgroup iy:=(4,5) pgrp:=Col(3); win -a body; //activate body workbook //plot data of different sex as different plot in one graph plotgroup iy:=(4,5) dgrp:=Col(3); /* The next example creates graph windows based on one group and graph layers based on a second group */ // Bring in Sample data fn$ = system.path.program$ + "Samples\Graphing\Categorical Data.dat"; newbook; impASC fn$; // Sort dataset sortcol = {4,3}; // sort by drug, then gender dataset sortord = {1,1}; // both ascending sort wsort nest:=sortcol ord:=sortord; // Plot each drug in a separate graph with gender separated by layer plotgroup iy:=(2,1) pgrp:=col(drug) lgrp:=col(gender); // Minimize all workbooks and tile remaining windows doc -e W { win -i; } win -s t; //Tile the windows horizontally
Keywords:-