Trellis Plots (Trellis Charts) are an important new feature in Origin 2017 as they have become a popular method to present data in a grouped manner. In this blog post, we will learn how to create a basic Trellis Plot with the goal of better understanding the process when using Origin. We will be using two years of regional Heating Degree Day data compiled from original data provided by the National Weather Service Climate Prediction Center.
Updates: We implemented Trellis with Double Y Axis in Origin 2019. Please read this blog for details.
You can download a zipped file containing the Origin Project File used in this post to follow along. And here is the graph as it will end up after we are done:
Step One: Preparing the Data
For the first step after compiling the original data, we set Region column as Categorical and specify custom sorting for graphing. Next, we add a new column entitled Normal. To this column, we add an F(x)= formula:(which is the new Spreadsheet Cell Notation in Origin 2017; this formula simply subtracts column E from column D).
Step Two: Create the Trellis Plot
We’ve plotted the Monthly Total (heating degree days) for three fuels grouped by Region and Year.
Step 3: Adjust Gaps between Panels, Bars and Bar Colors
With the graph active, navigate to the Format menu and choose Plot Properties… Open Plot Details. Pane tab is added for Trellis Plot-specific customization, such as
- Add, delete or modify horizontal or vertical panels.
- Set Gaps between panels
- Wrap or overlap panels
As you can see in image blow, Horizontal and Vertical Panels shows the same as what we set in Trellis Plot dialog. Add gaps to the panels as per steps 1 & 2 in the following image:
On the Color List tab, check Use custom increment list and customize the color list that appears being concerned with the first three colors.
Next, navigate to the Spacing tab and set the Gap Between Bars: 40%. Also select “Graph1” node on left panel to set the graph page size: set the Width: 10 inches and Height: 7 inches.
The Trellis Plot now looks like this:
Step 4: Formatting Panel Lines
First, double-click on the X-axis to open the Axis Dialog. Hide the bottom Lines and Ticks, but set the Top Lines and Ticks Thickness to 1.5 and Color to Gray. Set the Left and right Lines and Ticks to both be 1.5 Thickness and Gray Color.
Border lines between Panels are actually controlled in the Reference Lines tab in the Axis Dialog. The Image below is color-coded to highlight which border lines are associated with which Reference Lines:
To format the borders around each panel, navigate to the Reference Lines tab in the Axis Dialog. For the Vertical axis, click on the Details… button and in the Reference Lines dialog that pops up. Change the Color to Gray and the Thickness to 1.5 for both the “Axis Begin” and “Axis End” reference lines (see below) and click OK. Repeat this for the Horizontal Axis. Finally we’re done and can close the Axis Dialog by clicking OK.
Now the Trellis plot looks like:
Step 5: Adding an Additional Plot to the Trellis Plot
Now we add another plot to the Trellis plot as scatter plot to display the “Normal” heating degree day values. With the graph active, right click Layer 1 icon and choose Plot Setup… context menu to open the dialog. Choose Plot Type: Scatter. Check <autoX> as X to use row number as X values. Check “Normal” column as Y. Click Add button to add it into the graph. Click OK to close the Plot Setup dialog.
Though it is not obvious, there is a new plot on the graph. Open the Plot Details dialog, and select the node for the second plot. Set the Symbol Shape to the horizontal bar and set the Size to 11 and the Edge Thickness to 40. Click OK to close the Plot Details dialog.
Step 6: Finishing Touches
Now to modify tick labels and fill colors. Reopen the Axis Dialog. Set the Left Label Font Size to 10 and the Color to Black. Set the Right Label Font Size to 12, the Color to Black and make it bold. For the Right axis, navigate to the Table sub-tab and set the Fill Color to a very light shade of gray (a custom color). For the Bottom axis, hide the Tick Labels and Title. For the Top axis, set the Left Label Font Size to 10 and the Color to Black. Also for the Top axis, navigate to the Table sub-tab and set the Fill Color to the same shade of gray. Finally, set the Left Title to be Bold and Size 12.
To wrap things up, adjust the size of the graph layer, add a Title to the layer, and create a horizontal Categorical Legend and you end up with this graph:
Thank you for following along!
To see more trellis plot examples, please check out all the trellis plot examples in Help: Origin Central menu of Origin 2017.