1.2 FAQ-112 How do I add a second nonlinear x or y axis to my graph layer?

Last Update: 9/17/2021

Opposite Axes in Same Layer

A single layer is comprised of 4 axes: bottom X, top X, left Y and right Y. The graph below is a single layer where both the bottom X axis and the top X axis are displayed. The bottom X axis is wavelength in nanometers as present in the raw data. The top X axis represents energy. Each tick label on top axis is calculated with formula: Energy (ev) = 1240 / Wavelength (nm).


Here are the steps:

  1. Double-click the bottom X axis to open the Axis dialog.
  2. Select the Line and Ticks tab. Select Top on the left panel. Check Show Line and Ticks checkbox.
  3. Still with Top selected on the left panel, go to Tick Labels tab. check the Show check box.
  4. On Display tab, Enter 1240/x in Formula box and click OK button.
  5. If the tick labels do not display as nice rounded numbers, you can open the Axis dialog again and set decimal places or display on Display tab of Tick Labels tab.

FAQ-112 image03.gif

Note: Before Origin 2015, there is no Formula control in the Axis dialog. You have to use the Layer Management dialog as follows:

  1. Select Graph:Layer Management... menu.
  2. On Axes tab, expand the Top or Right branch, and check the Axis and Tick Label check boxes.
  3. Enter 1240/x in Formula box.
  4. Click Apply button on the bottom of the tab.
  5. Click OK button to close the dialog.

Note: In Layer Management dialog, Apply button must be clicked after making changes. Otherwise OK button will do nothing.

When creating a Formula for axis labels, use "x" to refer to the current axis, whether it is an X, Y or Z axis.

See Also: FAQ-122 How do I format the axis tick labels?

A New Layer

In the example above, top X and bottom X axes use the same settings. Only tick labels on top are calculated using the formula. If you want to control the top X axis independently, such as scale type and tick positions, e.g. show ticks in a reciprocal scale as the image below, you need to add a new linked layer with top axis showing.


Here are the steps.

  1. Select Insert: New Layer(Axes): Top X menu to add a linked new layer with Top X axis showing.
  2. Double-click the graph to open Plot Details dialog.
  3. Select TopX node on the left panel, and go to Link Axes Scales tab.
  4. Choose Custom in X Axis Link group, and enter the following formula to calculate the Start and End Values of the Top X axis.
    Next to X1 = enter: 1240/x1
    Next to X2 = enter: 1240/x2
    Click OK to close the dialog.
  5. Double-click the top x axis to open the Axis dialog.
  6. On Scale tab, select Reciprocal in the Type field.
  7. On Grids tab, check the Show check box under the Major Grid lines branch.
  8. On Tick Labels tab, choose the Format tab, and select 90 in the Rotate (deg.) dropdown list.

Note: If you want to change the scale range, please double click bottom axis to change its From and To values. Top axis range will update accordingly.

Tick Location From a Dataset

Continue with A New Layer section, you can even position major or minor ticks at specified locations (therefore, also the grid, if any), such as the image below.

FAQ-112 image05.gif

Here are the steps:

  1. Double-click on top axis to open the Axis dialog.
  2. On Scale tab, under Major Ticks branch, select By Custom Positions from Type drop-down list
  3. In Position combo box, enter 2 1.5 1 0.75 0.5 directly. Or, select the column from the drop down list if tick positions are stored in a column.

FAQ-112 image04.png

You may also wish to view this Quick Help: special ticks

Keywords:link, formula, equation, frequency, wavelength, energy, reciprocal, non-linear, scale