1.68 FAQ-194 How do I create a double Y axis graph?
Last Update: 1/6/2019
Plot Double Y from Worksheet
- From the worksheet, select both Y datasets.
- Choose Plot: Multi-Y: Double-Y, or select the Double Y Axis plot button from the 2D Graphs toolbar.
- If you want to change plot type. With each layer active, click line, scatter, line+symbol or Column button to change the plot type in the layer.
Note: Since Origin 2017, Double Y plot with one column and one line, or Double Y with two column bars can be plotted directly from Plot menu.
How to Add New Data to Right Y Axis in Existing Graph
- Choose Insert: New Layer(Axes): Right Y axis menu. A second layer is added with right Y axis showing. Note: The X axis has straight 1:1 relation with original layer.
- Add data to the newly added layer. There are three methods:
- Go to the worksheet window, select the second dataset, return to the graph window, and choose Insert: Plot to Layer: Plot Type.
- Alternatively, data can be selected and dragged from the worksheet and dropped to the graph layer.
- Alternatively, you can double-click on either the layer 1 or layer 2 layer icon in the upper-left hand corner of the graph. The Layer Contents dialog will allow you to add or remove data into this layer.
How to Move One plot to Right Y Axis
- Origin 2019 added context menu in Object Manager to move a plot to 2nd Y or other layers.
- Origin 2017 Sr1 added a new xfunction to move plot to new layer or another existing layer.
- With graph window active, choose Window: Script Window
- Run "laymplot -d"
- Specify which plot you want to add to right Y axis. Note: set Target Layer as 0 to move to new layer. Also check Layer Seting: Independent Y Linked X. Rescale Layer as Source and Target. This will make sure the right Y axis layer has same x scale as layer 1. Also both layer are rescaled to show all data. See this blog for detailed steps.
- In Origin 2017 Sr0 or earlier, there are following ways
- Follow the steps in How to Add New Data to Right Y Axis in Existing Graph section to add a right Y axis layer and add data in. Then remove the the extra plot from layer1.
- Using Extract to Layers tool
- With graph active, click Extract to Layers toolbar button, which is on Graph toolbar. Set both the Number of Rows and Number of Columns to 1.
- After graph is created, choose Graph: Layer Management menu
- On Link tab, select Layer2 on the left. set Link To as 1 and also set X Axis Link as Straight (1:1). Click Apply button.
- Still with Layer2 selected on the left, go to Axes tab. Uncheck Axis, Title, and Tick Label checkboxes under Bottom and Left nodes. Check them under Top and Right nodes.
- Click OK button.
- You may need to click Rescale to show All (Ctrl+R) with each layer active to show all plots in both layers.
- Update legend as needed.
Keywords:second, two, double Y, multi Y, multi X, link axis