TextEdit Icon

Data Transformations

To perform basic transformation of data, open the inspector window (using the Plot Inspector menu command or clicking the inspector icon in the window's tool bar), click on the Data tab, and proceed as follows:

  1. Select whether you want to transform X Axis or Y Axis data (only y axis transformations are allowed for bar charts).
  2. From the pop-up menu, select the data set to transform or choose to transform All Plots (note that labels will transform along with the data only when you are transforming All Plots).
  3. Select the transformation option:
    • (X or Y) + k(x,y) — add k(x,y) to x or y data
    • (X or Y) - k(x,y) — subtract k(x,y) from x or y data
    • (X or Y) * k(x,y) — multiply x or y data by k(x,y)
    • (X or Y) ÷ k(x,y) — divide x or y data by k(x,y)
    • (X or Y) ^ k(x,y) — raise x or y data to the k(x,y)th power
    • Log_10(X or Y) — log base 10 of x or y data
    • Log_|k(x,y)| — log base k(x,y) of x or y data
    • Swap with Y (X Axis only) — interchange the x and y data
    • [vs. | + | - | * | /] menu (Y Axis only) — when transforming Y Axis, choose operator from the first menu and another data set from the the second menu. The vs. option will plot the y data as a function of the y data of other selected data set. The other options will add (+), subtract (-), multiply (*), or divide by (/) the y data of other data set (this option not allowed for bar charts).
    • 1, 2, 3... (X Axis only) — replace x data with ordered integers
    • fit (Y Axis only) — fit to the selected function or smooth the data using a cubic-spline curve or using exponential smoothing. The fit, interpolant, or smoothing will create a new data set in the plot. The fitting coefficients will be documented within the name of the new data set.
      • A spline interpolant creates a cubic spline curve with "free" end conditions that goes though all points in the data set.
      • Fits with several coefficients (e.g., cubic fit with 4 coefficients), should have at least as many points as the number of coefficients.
      • Fits that need logs of data (i.e., y=a*x^b and y=a*exp(b*x)) can only be done if all y data are greater than zero.
      • A spline smoothing creates a best fit cubic spline curve using the number of intervals specified by the k(x,y) field. The number must be greater than zero and less than total number of points. Cubic spline smoothing works best when number of points is at least 4 times the number of intervals.
      • Exponential smoothing requires 0<k(x,y)<1 for the smoothing factor, where lower k(x,y) applies more smoothing. Exponential smoothing works best when x values are monotonically increasing and equally spaced. This fit option does require them to be non-decreasing, but does not require them to be equally spaced. More details on exponential smoothing can found on Wikipedia with α=k(x,y).
      • The fit option is not allowed for bar charts.
  4. If the transformation option depends on k(x,y), enter any function of x and y, which refer to the x and y value of the point being transformed. If k(x,y) is a constant, just enter the constant value. See information on plotting an expression for details on entering a function.
  5. Click the Transform button.

Note: Data transforms also transform error bars to reflect the same range of data as the original error bars (unless the transform needs log of a negative number). Note that when plotting "vs." a different data set or replacing x data with "1, 2, 3...", the x error bars are removed.

Note: In the [vs. | + | - | * | /] transformation for the Y axis, the y data from the second data set are interpolated to x data points of the first data set and then used for the new x data (vs.) or combined with first data set (all others). If some of the x data points of the first data set are out of the range for the second set, the y value at the nearest end point of the second data set is used instead.

Note: Although labels will move when you transform All Plots, they will not move if the transform option is "[vs. | + | - | * | /]," "1, 2, 3...," or "fit".