Make Stacked Graph with Same Axis Unit Length

posted in: Graphing | 1

Origin has a layer level option linking axis length to its scale so that axis will have the same unit length. This post will help you to go one step further, because in categorical data, we only want to link one of the axis (Y axis) to its scale, while keep X as it is for it’s just categories.

If you want to walk through the steps with me, please download this sample data.

The raw data shows as below:

Post2486_08

Highlight all four columns and plot a column graph. You can finish most of the customization since Origin’s batch plotting can duplicate the graph with new data. Here are some important changes that you need to make:

  1. Open the Axis Dialog for Y axis and set its Rescale mode to Auto.so that when new data be used, the Y axis range can be adjusted accordingly.
  2. Hide the X axis tick and labels because only one of the three graphs needs it.
  3. Right click in white area and choose Add/Modify Layer Title and enter %(1Y, @WS). Right click it and choose Programming Control…. Set Link to (%,$), Substitution Level to 1. This will convert the subsitution notation %(1Y, @WS) into sheet name.
  4. In Plot Details dialog, choose Layer1 on left panel, go to Display tab and change Scale Elements to be Fixed Factor with value so that everything will not be scaled with layer size changing.
    Post2486_02
  5. Right click graph window title and select Duplicate (Batch Plotting) : Duplicate with New Sheets/Books. Select the other two sheets and click OK.
    Post2486_04
  6. Update the color for the duplicated graphs first since they uses the same color setting as the first one.
  7. Go to menu Graph: Merge Graph Windows and set it as a 3*1 layout. Check Set Layer Height by Common Scale checkbox so that each layer height will adjust proportionally based on the range of axis.
  8. Click OK and you will have a new graph window just like the preview.
    Post2486_05_2
  9. However, form the preview we see that the Test-1 layer is on the top instead of bottom. That’s because this tool be default place the graphs based on the list in Graphs. Change the Merge drag-down to be Specified so that the list can be editable. Or in the graph already made, choose Graph: Layer Management menu.Go to Size/Position tab to swap layer1 and layer3. Please make sure click Apply button on the tab before clicking OK button to close the dialog.

10. Turn the X axis tick and label back on the bottom axis.You will got your graph as below:

Post2486_01

 

You can look at the expected graph under Result folder in the opj you downloaded.

One Response

  1. quanchao zeng

    nice

Leave a Reply