OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis                     
 
Skip Navigation Links
All BooksExpand All Books
Origin HelpExpand Origin Help
Customizing Your GraphExpand Customizing Your Graph
Customizing Plot ElementsExpand Customizing Plot Elements

9.3.8 Trellis Plot

Trellis plots or Trellis graphs (also sometimes termed "Trellis displays" or simply "Trellis") are a means of graphing multivariate data, as an array of M X N panels. As a simple example, two "primary variables" might be chosen to represent a common set of axes (repeated in each panel), against which all combinations of two categorical variables (termed "conditioning variables") are plotted. Each combination of categorical values is plotted as a separate panel.

Trellis plots example.png

In Origin terms, when your data includes a column of categorical data, or multiple columns characterizing some sort of nested sub-grouping of data, you might gain from plotting the data as a Trellis. Trellis plots were introduced in Origin 2017.

Creating a trellis plot

  1. Highlight one or more Y worksheet columns (or a range from one or more Y columns).
  2. Select Plot: 2D: Trellis.

This will open the plot_group dialog

Trellis 01.png

The following quick example uses the dataset <Origin exe folder>/Samples/Statistics/LogRegData.dat, imported (File: Import: Single ASCII) using default settings. The dataset contains two columns of categorical data: Gender (Col(C)) and Career_Change (Col(D)). We are going to add one more categorical variable, City, and then plot this dataset in a Trellis.

  1. Click the Add New Columns button Button Add New Columns.png on the Standard toolbar to add an empty column to the right side of the sheet.
  2. Highlight cells 1 - 350, right-click and choose Fill: Arbitrary set of Text&Numeric Values and recreate these settings in the dialog box that opens:
  3. Trellis 16.png

  4. In the Long Name cell in the cities column, type Cities.
  5. Highlight Col(B) and from the menu, select Plot: 2D: Trellis Plot to open the plot_group dialog.
  6. Select Scatter for Plot Type. Under Variable for Separate Panels, click the triangle beside Horizontal and add Gender and Cities (in that order). For Vertical, select Career_Change.
    Trellis 18.png
    Click OK to create your Trellis.
    Trellis 17.png

Controlling the arrangement of horizontal and vertical panels

Method 1. Use the plot_group dialog's Variable for Separate Panels controls to determine the horizontal and vertical arrangement of panels
Trellis 02.png
Method 2. Use the Plot Details dialog Panel tab controls to re-arrange plots in panels after plotting
  1. In the left panel of Plot Details, highlight a data plot. The right panel will include a Panel tab.
    Trellis 03.png
  2. On this tab, you can re-arrange panels by size or by grouping column(s).
    • by size
      Trellis 04.png
    • by grouping column(s)
      Trellis 05.png
  1. Import the file <Origin exe folder>/Samples/Statistics/body.dat (File: Import: Single ASCII) and accept default settings. We are going to plot height vs. weight data, categorizing by age and gender, respectively.</li>
  2. Set height column as X by right clicking on it and selecting Set As: X.
  3. Highlight height and weight columns, and select Plot: 2D: Trellis to open the plot_group dialog.
  4. Under the Variable for Separate Panels branch, select the age column for Horizontal and the gender column for Vertical.
    Click OK to create your Trellis.
Trellis 06.png

Mapping color to data plots

Color-map plots to a specified column
  • In the plot_group dialog, specify the mapped color column in Variable to Color Data Points.

Or

  • In the Plot Details dialog, go to Symbol tab, set Symbol Color: By Points: Indexing/Color Mapping.
Color map plots to a color increment list
  1. In the Plot Details dialog, go to Symbol tab, set Symbol Color: By Points: Increment
    Trellis 07.png
  2. Go to Panel tab, you can increment plot colors within a panel or between panels.
    • within a panel
      Trellis 08.png
    • between panels
      Trellis 09.png

Wrapping panels

When you have many categories in a grouping column, the Trellis plot can becomes squeezed for space. The solution is to "wrap" panels, breaking a row or column of panels into multiple rows/columns.

  1. Double-click on a plot to open the Plot Details dialog.
  2. On the Panel tab, select the Wrap Panels if Columns/Rows Exceed checkbox and enter the desired number in the edit box.
Trellis 11.png

The following quick example uses one of the Origin Central sample OPJs.

  1. Choose Help:Origin Central... to open the Origin Central dialog.
  2. Select the Graph Sample tab on the left, and on the right select Trellis Plot from Samples in drop-down list.
  3. Double-click on the first cell of the second row to open the OPJ. Activate the workbook Book9. We are going to create a female vs. male Trellis categorized by years, and then wrap it to 3 X 2 panels.
  4. Right-click on column C and select Set As: X.
  5. Highlight column C and D, select Plot: 2D: Trellis to open the plot_group dialog.
  6. Select Scatter for Plot Type.
  7. Select column B for Variable for Separate Panels: Horizontal. Click OK to create a Trellis.
  8. Double-click on the scatter plot to open the Plot Details dialog. On the Panel tab, select the Wrap Panels if Columns/Rows Exceed checkbox and enter 3 in the edit box.
Trellis 12.png

Combine multiple panels into a single panel

  1. Create a set of categorized plots in multiple panels by the plot_group dialog.
  2. Double-click on the Trellis to open the Plot Details dialog. On the Panel tab, check Overlap Panels in the Horizontal Panel or Vertical Panel group.
Trellis 19.png

The following quick example uses one of the Origin Central OPJs.

  1. Select Help: Origin Central to open the Origin Central dialog. In this dialog, select Graph Sample in left panel, and then choose "Trellis Plot" from Samples in drop-down list.
  2. Double-click on the graph in the lower right corner, "Trellis - Overlap Panels with Multiple Categories Combination".
  3. Activate workbook Book8. We are going to plot a set of Line+Scatter curves, grouped by columns Location and Treatment, in one panel.
  4. Highlight column C and select Plot: 2D: Trellis Plot to open the plot_group dialog.
  5. Select Line+Symbol for Plot Type.
  6. Select column F and G for Variable for Separate Panels: Horizontal. Click OK to create the Trellis.
  7. Double-click on the Trellis to open the Plot Details dialog. On the Panel tab, check Overlap Panels in the Horizontal Panel group.
  8. Go to Symbol tab, set Symbol Color: By Points: Increment from: to red color.
  9. Go to Panel tab. Select Between Panel from the Increment on Panel group.
Trellis 10.png

Reference

  1. Trellis Display: Interview. Bell Labs web page: http://ect.bell-labs.com/sl/project/trellis/interview.html.
 

© OriginLab Corporation. All rights reserved.