OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis     
 
Skip Navigation Links
All BooksExpand All Books
X-FunctionExpand X-Function
X-Function ReferenceExpand X-Function Reference
PlottingExpand Plotting

2.10.6 plotgroup

Brief Information

Plot by page group, layer group, and data group.

Command Line Usage

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

Additional Information

This feature is updated in 9.0 to add an option to hide output graphs.

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iy

Input

XYRange

<active>
The input XYRange data to plot by group. This is the data which actually gets plotted.
Column for Page Group pgrp

Input

Column

<optional>
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

<optional>
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

<optional>
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

0
Layers will be arranged vertically or horizontally in Page.

Option list:

  • vertical:Vertical
The layer will be arranged vertically in Page.
  • horizontal:Horizontal
The layer will be arranged horizontally in Page.
Graph Template template

Input

string

origin
Specify the template used to plot the graph layers.
Plot Type type

Input

int

1
Specify the plot type to plot the graphs.

Option list:

  • line:Line
  • scatter:Scatter
  • linesymb:Line+Symbol
  • column:Column
Sort Worksheet by Groups Data sort

Input

int

0
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:

  • none:None
  • ascending:Ascending
  • descending:Descending
Hide Newly Created Graph hide

Input

int

0
Specify whether to hide newly created graph(s) (1) or not (0).

Description

The function can be used to plot by column data for page group, for layer group, and for data group.

Examples

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

Related X-Functions

 

© OriginLab Corporation. All rights reserved.