
Contents |
Plot XY data with specific properties
Why can't I change the symbol from this ugly rectangle to s.th. else? If I can, where is that command described?
Minimum Origin Version Required: Origin 8 SR0, updated in Origin 8.5.1 SR0.
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input | iy |
Input XYRange | |
Specifies the input data, including X column, Y column, Y error column. |
| Plot Type | plot |
Input int | |
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 | |
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 | |
Specifies whether to rescale the graph. |
| Legend | legend |
Input int | |
Specifies whether to generate the legend on graph. |
| Plot Color | color |
Input int | |
Specifies the color of plots. |
| Layer to Plot into | ogl |
Output GraphLayer | |
Specifies the graph layer to add plots. Use range syntax. |
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.
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).