# Manipulating Data

Graphs provides a wide range of operations for manipulating data. All operations work the same regardless of whether the item was imported from a file or generated from an equation. When a region of the canvas is selected using the Select tool, only data within that region will be affected.

Translate: Shift data along the X or Y axis.

Multiply: Scale data along the X or Y axis.

Normalize: Scale Y values relative to the maximum.

Center: Shift data so it is centered on the X axis.

Smoothen: Reduce noise in a dataset.

Derivative: Compute the derivative.

Integral: Compute the cumulative integral.

Fourier Transform: Transform data to the frequency domain.

Combine: Merge multiple datasets into one.

Shift: Automatically offset datasets so they do not overlap.

Cut: Remove data within the selected region.

Custom Transformations: Apply an arbitrary equation to the X and Y coordinates.

# Translate

Translates all selected data by a fixed offset along the X or Y axis. Enter the desired offset in the corresponding entry field and apply the operation.

# Multiply

Multiplies all selected data by a fixed factor along the X or Y axis. Enter the desired multiplier in the corresponding entry field and apply the operation.

# Normalize

Scales the Y values of all selected data so that the maximum value becomes 1. All other values are divided by that maximum accordingly.

# Center

Shifts data along the X axis so that it is centered. Two modes are available: centering on the maximum Y value, which shifts the peak of the data to zero, and centering on the middle of the X range. The mode can be configured in the smoothen settings.

# Smoothen

The smoothen operation reduces noise in a dataset. Two modes are available, configurable via the smoothen settings dialog.

The Savitzky-Golay filter fits a polynomial through the surrounding data points rather than taking a simple average. This makes it possible to recover the underlying signal more faithfully from noisy data, and is the recommended choice in most cases.

The moving average replaces each point with the average of a surrounding window of points. This is simpler but may blur sharp features and cause changes in the data to appear shifted.

# Derivative

Computes the numerical derivative of the selected data, replacing the Y values with the rate of change with respect to X. For equations, the derivative is calculated analytically.

# Integral

Computes the cumulative integral of the selected data using the trapezoidal method, replacing the Y values with the running area under the curve. For equations, the integral is calculated analytically.

# Fourier Transform

Transforms the selected data from the time or spatial domain into the frequency domain using the Fast Fourier Transform. An inverse transform is also available to convert back.

# Combine

Merges all selected datasets into a single new dataset. The resulting data is sorted by X value. If all selected items have error bars, those are preserved in the combined output.

# Shift

Automatically offsets each selected dataset along the Y axis so that the items are spread out and do not overlap one each other. The shift amount is calculated based on the range of each dataset and respects the current axis scale, including logarithmic scales.

# Cut

Removes all data points within the currently selected region. This operation requires the Select tool to be active and a region to be highlighted on the canvas.

# Custom Transformations

Custom transformations let you modify the X and Y coordinates of a dataset point by point using equations of your choice. For instance, to square all Y values, set `Y = Y²` in the Y field and leave `X = X` in the X field. Coordinate names are not case-sensitive.

The following extra variables are available for custom transformations:

General:

`x`, `y`: original coordinate values

`counts`: total number of data points

X-Axis:

`x_min`, `x_max`: minimum and maximum

`x_mean`, `x_median`: average and median

`x_std`, `x_sum`: standard deviation and sum

Y-Axis:

`y_min`, `y_max`: minimum and maximum

`y_mean`, `y_median`: average and median

`y_std`, `y_sum`: standard deviation and sum

Trigonometric functions use radians by default. Append d to use degrees, e.g., `sind(x)` or `cosd(x)`.