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

subtract_line

Contents

Menu Information

Subtract Straight Line

Brief Information

Subtract the active plot from a straight line formed with two points picked on the graph page

Command Line Usage

subtract_line x1:=0 y1:=0.5 x2:=200 y2:=3.5;

Variables

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

Input

XYRange

<active>

Specifies the input data that will be subtracted.

X1 x1

Input

double

0

Specifies the X value of the first point.

Y1 y1

Input

double

0

Specifies the Y value of the first point.

X2 x2

Input

double

<unassigned>

Specifies the X value of the second point.

Y2 y2

Input

double

<unassigned>

Specifies the Y value of the second point.

Output oy

Output

XYRange

<input>

Specifies the output range for the subtracted data.

See the syntax here.

Description

This X-Function can be used to subtract a straight line from a data set. The straight line is determined by two points. If you use this X-Function from the menu and a graph is active, you can click on the graph to select these two points. If you use this X-Function from script, you can specify the X and Y values of these two points.

Examples

In this example, we use the subtract_line X-Function to subtract a straight line from the data plot.

  1. Create a new graph page by clicking the New Graph button on the Standard toolbar.
  2. Import the file \Samples\Spectroscopy\Raman Baseline.dat into the graph.
  3. From the Origin menu, choose Analysis: Data Manipulation: Subtract Straight Line. Double-click on the beginning of the plot and then the end of the plot.
    Image:subtract_line_help_English_files_image002.jpg
  4. Click the Rescale button on the Graph toolbar. We can see the graph as follows:
    Image:subtract_line_help_English_files_image004.jpg

Related X-Functions

subtract_ref