The Basics of Creating a Trellis Plot with Origin 2017

はじめに

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:

trellisbasicsbloggraph1

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: D-E (which is the new Spreadsheet Cell Notation in Origin 2017; this formula simply subtracts column E from column D).

trellisbasicsblogsheet1

Step Two: Create the Trellis Plot

Activate the worksheet and, without selecting any data, choose Trellis Plot… from the newly redesigned Plot menu:
trellisbasicsblogplotmenu

Follow the numbered steps in the picture below to create Trellis Plot.
trellisbasicsblogdialog1

We’ve plotted the Monthly Total (heating degree days) for three fuels grouped by RegionYear.

trellisbasicsbloggraph2

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
  • etc.

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:

trellisbasicsblogpddlg1a

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:

trellisbasicsbloggraph3

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:

trellisbasicsblogborders2

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.

trellisbasicsblogreflines1

Now the Trellis plot looks like:

trellisbasicsbloggraph4a

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 LabelsTitle.  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:

trellisbasicsbloggraph5

 

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.

 

 

About Chris Drozdowski

Chris Drozdowski is a Product Support Engineer at OriginLab. He loves to talk to customers and educate them. He particularly relishes diagnosing and solving difficult, edge-case issues. As well, he contributes code to help solve problems or enhance user experience. In his down time at work, he likes to research and write about esoteric product features. Outside of work, he enjoys spending time with his family, having fun with C++, working on his aquarium, and exploring craft beers.

View all posts by Chris Drozdowski →

5 Comments on “The Basics of Creating a Trellis Plot with Origin 2017”

    1. Hello,

      If you have two dataset with same grouping information columns, you can plot each trellis plot first.
      Then use Merge Graphs to merge them into a 1×1 panel so they overlap on each other but with different Y axis ranges.

      Then you can move one Y tick label to the right. Also move the table-like tick label to the further right.

      If it doesn’t work well, feel free to email tech@originlab.com with your data so that we can take a further look.

      Thanks, Snow

    2. Hi Ksenia,

      We are actually going to add double-Y trellis plot support in the upcoming Origin 2019.

      CP

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です