OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

plotxy

Contents

Brief Information

Plot XY data with specific properties

Where the heck are the properties listed???

Why can't I change the symbol from this ugly rectangle to s.th. else? If I can, where is that command described?

Additional Information

Minimum Origin Version Required: Origin 8 SR0, updated in Origin 8.5.1 SR0.

Command Line Usage

  1. plotxy iy:=(1,2);
  2. plotxy iy:=(1,2,3); // Plot col(2) with col(3) as error bar
  3. plotxy iy:=[Book1]2!(1,3) o:=[Graph1]1!;
  4. plotxy (?,1:end);
  5. plotxy [Book1]2!(#, 3);
  6. plotxy (1:3)!(1,2) plot:=200; // Plot col(2) of the 1~3 sheet in the active workbook.
  7. plotxy ((1,2[1:6]),(1,2[7:12]),(1,2[13:18])) plot:=202 ogl:=[<new template:=doubley name:=SamplePlot>]; // Plot 3 ranges of col(2) into a specified graph template and name the graph as SamplePlot.
  8. plotxy (1,3) ogl:=2; // Plot the col(3) into layer 2.

Variables

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

Input

XYRange

<active>

Specifies the input data, including X column, Y column, Y error column.

Plot Type plot

Input

int

201

Specifies the plot type. The most common are 200, line; 201, scatter; 202, line + symbol. For the list of all plot types, see LabTalk Language Reference: Command Reference: Worksheet (command) (-p switch). Note: only the plot types for XY range can be used.

Symbol Size (Pts) size

Input

double

-1

Specifies the symbol size in points. Here the default value is -1, which means that the size will always follow the symbol size specified in the template automatically.

Rescale rescale

Input

int

1

Specifies whether to rescale the graph.

Legend legend

Input

int

1

Specifies whether to generate the legend on graph.

Plot Color color

Input

int

0

Specifies the color of plots.

Layer to Plot into ogl

Output

GraphLayer

<new>

Specifies the graph layer to add plots.

Use range syntax.

Description

This function plots data from specified range, which can include Y error column. You can specify the plot type and symbol size. You can also specify whether to show the legend and whether to rescale the graph.

Examples

There are special notation '?' and '#' in the range as the parameter. '?' indicates that the range is forced to use worksheet designation, and will fail if the range designation does not satisfy the requirement, and '#' means that the range ignores designations and use row number as X designation. For example,

plotxy (?, 5);  // if col(5) happens to be X column call fails
plotxy (#, 3);  // plot col(3) as Y and use row number as X

To make a plot with Y error, one more column can be added into the input range as Y error. For example:

plotxy iy:=(1, 2, 3);  // plot col(2) vs col(1), with col(3) as Y error

The following example shows how to add a curve into specified graph layer.

newbook;
string fn$ = System.path.program$ +
		"Samples\Curve Fitting\Exponential Decay.dat";
impasc fn$;
string bn$ = %H;
int nCols = wks.ncols;
win -t Plot;	// Create an empty plot
loop (ii, 2, nCols)
{
	// Add dataset into a layer
	plotxy [bn$]1!$(ii) plot:=201 rescale:=1 color:=ii ogl:=!1;
}
// Group the curves
layer -g;

For more examples, please refer to XF Script Dialog (press F11).