This is an archived page, please click here to view the latest updates.

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

Controlling the Axis Scale Type


You can configure the graph axes to display log, log2, ln, probability, probit, reciprocal and offset reciprocal scales, as well as linear scales.

In addition, you can combine different axis scales in a single graph by linking to a second layer or by creating a nonlinear scale on a second axis in the same layer.

Contents

Changing the axis scale type

  1. Double-click on the X, Y, or Z axis tick labels to open the Axis dialog box.
  2. Select the Scale tab.
  3. Select Horizontal, Vertical, or Z Axes from the Selection list box.
  4. Select the axis scale from the Type drop-down list (see table, below).
  5. Click OK to close the dialog box and effect changes in the graph window.
Linear

Standard linear scale: X'=X.

Log10*

Base 10 logarithmic scale: X'=log(X).

Probability

Represents the inverse of a cumulative Gaussian distribution. Plotting a cumulative Gaussian distribution produces a sigmoidally-shaped curve. This curve, when displayed on a probability scale, appears as a straight line. Since probabilities are expressed as percentages, all values must fall between 0 and 100. The probability scale range is 0.0001 to 99.999.

Probit

Like the probability scale, a sigmoidally-shaped curve plots as a straight line. In this case, however, the scale is linear, and the increment between tick marks is exactly one standard deviation. The value "5" on the scale shows the mean, or 50% probability. "6" is one standard deviation away, etc.

Reciprocal

Reciprocal scale, where X'=1/X.

Offset Reciprocal

Offset reciprocal scale, where X'=1/(X+offset). Offset is defined as 273.14, where 273.14 is the absolute temperature for 0° C.

Logit

Logit=ln(Y/(100-Y)). As with the probability and probit scales, a sigmoidally-shaped curve plots as a straight line.

ln

Natural log scale (base e logarithmic scale).

log2

Base 2 logarithmic scale.

A note about log10 scales:*

Starting with Origin 7, if the log scale range is within one decade, the ticks and grids will be linear.

A LabTalk system variable @TL determines whether to use linear tick marks by the following relation:

10 * log10(max/min) <= value

Thus, to support linear tick locations for two decades, for example, set this variable to 14 by entering the following at the command line:

@TL = 14;

The default value for @TL is 10.

Creating an offset reciprocal scale and linking to a linear scale on a second axis

The offset reciprocal scale type is defined as X'=1/(X+273.14), where 273.14 is the absolute temperature corresponding to zero degrees Celsius.

We can create a second layer and add a custom link between the first layer's offset reciprocal scale and the second layer's linear scale and use the resulting graph window to plot temperature data on the two scales.

  1. Click the New GraphImage:Button_New_Graph.png button on the Standard toolbar.
  2. Double-click on the X axis.
  3. Select the Scale tab (if it is not already active).
  4. Type 0 in the From text box and 100 in the To text box.
  5. Select Offset Reciprocal from the Type drop-down list.
  6. Type 10 in the Increment text box.
  7. Click OK to close the dialog box.
  8. Select Graph: New Layer (Axes): (Linked): Top X.
  9. Press CTRL while double-clicking on the layer 2 icon located in the upper-left corner of the graph. This action opens the layer's Plot Details dialog box.
  10. Select the Link Axes Scales tab.
  11. Select the Custom radio button in the X Axis Link group.
  12. In this same group, type 1/(X1+273.14) in the X1 text box.
  13. Type 1/(X2+273.14) in the X2 text box.
  14. Click OK to close the dialog box. The offset reciprocal scale is created.
Image:Controlling the Axis Scale Type-1.png

Creating a nonlinear scale on a second axis (one layer; same tick locations as primary axis)

Using a LabTalk Script command, you can create a nonlinear scale on a top X or a right Y axis in a 2D graph, based on values of the bottom X or left Y axis. This is a simple procedure, and does not require creation of aUsing a LabTalk Script command, you can create a nonlinear scale on a top X or a right Y axis in a 2D graph, based on values of the bottom X or left Y axis. This is a simple procedure, and does not require creation of a second graph layer. Tick marks on the second axis are located opposite tick marks on the primary axis.

For example, in this graph the bottom X axis scale reads in some quantity X, while the top axis scale is in units of 1/X.

Image:Controlling the Axis Scale Type2.png

In order to create this graph, you would do the following:

  1. Create the 2D plot.
    Make the top axis visible and turn on grid lines:
  2. Double-click on the bottom X axis. This opens the X Axis - Layer 1 dialog box.
  3. Click on the Title & Format tab.
  4. Select Top in the Selection list box.
  5. Check Show Axis & Ticks. The top axis is now displayed.
  6. Click on the Tick Labels tab and enable Show Major Labels.
  7. Choose the Grid Lines tab and select Major Grids (optional).
    Set the top axis tick labels by defining your function:
  8. Click the Command Window button Image:Button_Command_Window.png on the Standard toolbar.
  9. At the command line, type the following:
layer.x2.label.formula$ = "1/x" <ENTER>

This computes and places labels on the top X axis, at positions corresponding to the tick marks and labels of the bottom X axis, using the formula specified between the quotation marks. This formula can be any function of X that is calculable using LabTalk.

Note: Similar to the top X axis in this example, you can turn on right Y axis and create labels for that axis too. However, you should not refer to "Y" in your formula; rather you would still use "x," as in:

layer.y2.label.formula$ = "1/x"

Creating a nonlinear scale on a second axis (two layers; custom tick locations)

In the last procedure, we used a formula to create a nonlinear scale on a second x axis. One drawback for some users will be that the scale values displayed on the second axis are not nicely-rounded numbers. If you (1) do not need ticks on the second axis to align with ticks on the primary axis and (2) you want control over the scale values that display on the second axis, there is an alternate procedure.

Note that in this graph, the values on the nonlinear scale on the top X axis are derived from the reciprocal of the values on the linear scale on the bottom X axis.

Image:Controlling the Axis Scale Type-3.png

The following steps describe how to create such a graph:

  1. Create a 2D graph (line, scatter, column, etc.).
  2. From the menu, choose Graph: New Layer(Axes): Linked: Top X. This adds a second layer to the graph window.
  3. From the menu, choose Format: Layer and on the Link Axes Scale tab, establish the X Axis Link as Straight (1:1) and click OK. The top and bottom scales should now be identical.
  4. Add two columns to your worksheet.
  5. Decide what scale values you want on the top scale. In this example, we chose 1, 0.1, 0.05, 0.04, 0.035. Type your chosen values into the fourth column of your worksheet.
  6. In the third worksheet column, you will enter the values that control the tick mark placement on the top axis. Since the top axis scale in our example is the reciprocal of the lower scale, you will need to compute the functional inverse of the top scale values and put those in the third column. Hint: You can do this using the Set Column Values feature. Select the third column, right-click, choose Set Column Values and enter (in the case of our example) the following and click OK:
    1/Col(D)
  7. While making sure that the newly added graph layer is the active layer, open the Command Window (Window: Command Window) and enter the following at the command line:
    layer2.x.ticksbydata$=Book1_C <ENTER>
    ... where Book1_C is the worksheet column containing the tick location data. The tick marks are drawn on the top scale. We now need to customize the tick marks so that the scale reads properly.
  8. Double-click on the top axis tick labels. On the Tick Labels tab, set Type = Tick-indexed dataset, then set Dataset = Book1_D, where Book1_D is the column that contains our custom tick labels (1, 0.1, 0.05, 0.04, 0.035).
  9. To complete the graph, select the Scale tab and turn of minor ticks by setting #Minor Ticks = 0. Click OK to close the Axis dialog box and complete the graph.

Note: To set up a similar relationship for a second Y axis, you would need to alter your command slightly:

layer2.y.ticksbydata$=<dataset containing tick mark positions>