# Showcase a 2D Graph with Multiple Origin Features

This blog showcases Origin’s graphing capabilities via a real life example of plotting oxygen consumption and heart rate over time during a VO2max protocol, during which a subject runs on a treadmill, starting at 8 km/h with 1km/h increment each 2 minutes, until exhaustion. The data and graph were provided by Antoine Couturier, INSEP.

Features covered in this blog are

• adding references lines that show the period over which signals are averaged
• using line plot with 2 points segment to show the averaged values
• customing X increment, corresponding to each speed increment, and end of test
• customing X tick label, corresponding to speed, and positioning label between major ticks
• adding new layer for new data to create double Y plot
• customing point showed as big open circle for showing maximum values

In the graph,  the average values during certain time range (shadow area) are shown as small steps on the graph. X labels are customized corresponding to speed, centered between major ticks. Please first download the zip file and unzip it. You can view the resulting graph in the Result folder. Or you can go the Data folder and follow the steps below to generate your own plot:

1. Activate Book1 in Data folder which has the data needed for this graph. First let’s plot the oxygen consumption over time. Highlight column B (VO2/Kg) and select Plot:2D:Line to make a line plot.

1. Double click the line plot to open up the Plot Details dialog. Under Line tab, set Width to 3, set Transparency to 75%. Click the triangle button besides Color, below Custom click on an empty color entry to add new color.  Enter “1F497C” in the text box besides # and click OK. Click Apply, the graph should look like below:

2. Now let’s add the second plot. Go back to the worksheet Book1, highlight column E (Mean VO2). Hover the mouse to the edge of the column until the cursor changes to a small graph symbol. Drag and drop the column into the graph. Double click this new plot to open up the Plot Details dialog. Under Line tab, set Connect to 2 Point Segment, set Width to 4 . Click the drop-down list of Color, and pick the previously created new color from Recent Colors list. Click OK.

1. Next we add the label to the second plot. Select column H (Label VO2) and drop it into the graph, a line plot is added. Double click the plot to open up the Plot Detail dialog. Change the Plot Type to Scatter. Under Symbol tab, set the Size to 0. Since we only need the label and don’t want to show the symbol.

1. Go to Label tab, check the box Enable. Set the label Size to 15, label Color to the previously created color as well. Set Position to Above. Make the label bold. Click OK.

1. Double click the X axis to open up axis setting dialog. First under scale tab, below Major Ticks branch, set Type to “By Column Positions” and set Position to column J (X axis).  Set Minor Ticks Count to 0.

1. Select Tick Labels tab then select Display sub-tab. Set Type to “Text from dataset” and set Dataset Name to column K (Tick labels).

1. Select Format sub-tab. Set color to “dark blue”. Check the box besides Bold. Set Alignment to “Center between Ticks”. Click Apply, the tick labels should display as below:

1. Select Reference Lines tab. Set Reference Lines at Values to column D (Ref Lines). Check Alternate Fill checkbox.  We only want to show filling between reference lines. We don’t want to reference lines show. So click the checkbox in Line column header twice to clear all checkboxes in Line column. Click Detais… , select all added lines in the left and set Transparency to 70.

1. Select Grids tab and in the left panel, select Horizontal. Check the box to show Major Grid Lines and Minor Grid Lines. Also change the color accordingly.

1. Customize the color and formats of the tick labels, axis titles, etc. Once done, the graph should look like the following.

1. The heart rate values are very different from oxygen consumption values. So we want to plot them with a separate Y axis. First click the Add Top-X Right-Y Layer button on the right side of Origin workspace to add a new layer.

1. We want both layers use the same X axis. So double click inside the second layer to open up the Plot Details dialog. Select Link Axes Scales tab. Set Link to to Layer1. Set X Axis Link to Straight (1 to 1). Change the axes color to “C0504D” (Highlight the axis in the Layer, click the Line/Border color button in the menu bar to set it to different color). Customize other axis formats accordingly.

1.  Repeat the steps 1~11 to make similar plots in Layer2. This time use columns C(HR bpm), F(Mean HR) and I(Label HR) as the line plot, “step” plot and label. Once finished, the Graph looks like below:

1. Lastly, we are going to emphasize the maximum average values with big open circles: Hold down Ctrl key and double click on the symbol label “73.9” to open up the Plot Details dialog. Under Label tab, set Vertical Offset to 40 and Position to Center. Select Symbol Tab, Set the symbol type to Open circle, set Size to 40 and Fill Color to None. Do the same for the maximum heart rate average 188 point.

1. Click OK to get the final graph:

View all posts by Yiming Chen →

### 2 Comments on “Showcase a 2D Graph with Multiple Origin Features”

1. Alex says:

Is somewhere there an example on drawing a multi-line graph with automation server?

1. CP says:

Hi Alex,

We certainly need to make more samples, and you must have already looked at this one

https://www.originlab.com/doc/COM/Plotting

Maybe you can let us know how do you plan to call Origin from, C#, Excel, Matlab, Python?

CP