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.
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
- Highlight one or more Y worksheet columns (or a range from one or more Y columns).
- Select Plot: 2D: Trellis.
This will open the plot_group dialog
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
Method 2. Use the Plot Details dialog Panel tab controls to re-arrange plots in panels after plotting
- In the left panel of Plot Details, highlight a data plot. The right panel will include a Panel tab.
- On this tab, you can re-arrange panels by size or by grouping column(s).
- by size
- by grouping column(s)
- 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>
- Set height column as X by right clicking on it and selecting Set As: X.
- Highlight height and weight columns, and select Plot: 2D: Trellis to open the plot_group dialog.
- 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.
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.
- 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
- In the Plot Details dialog, go to Symbol tab, set Symbol Color: By Points: Increment
- Go to Panel tab, you can increment plot colors within a panel or between panels.
- within a panel
- between 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.
- Double-click on a plot to open the Plot Details dialog.
- On the Panel tab, select the Wrap Panels if Columns/Rows Exceed checkbox and enter the desired number in the edit box.
The following quick example uses one of the Origin Central sample OPJs.
- Choose Help:Origin Central... to open the Origin Central dialog.
- Select the Graph Sample tab on the left, and on the right select Trellis Plot from Samples in drop-down list.
- 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.
- Right-click on column C and select Set As: X.
- Highlight column C and D, select Plot: 2D: Trellis to open the plot_group dialog.
- Select Scatter for Plot Type.
- Select column B for Variable for Separate Panels: Horizontal. Click OK to create a Trellis.
- 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.
Combine multiple panels into a single panel
- Create a set of categorized plots in multiple panels by the plot_group dialog.
- 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.
The following quick example uses one of the Origin Central OPJs.
- 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.
- Double-click on the graph in the lower right corner, "Trellis - Overlap Panels with Multiple Categories Combination".
- Activate workbook Book8. We are going to plot a set of Line+Scatter curves, grouped by columns Location and Treatment, in one panel.
- Highlight column C and select Plot: 2D: Trellis Plot to open the plot_group dialog.
- Select Line+Symbol for Plot Type.
- Select column F and G for Variable for Separate Panels: Horizontal. Click OK to create the Trellis.
- Double-click on the Trellis to open the Plot Details dialog. On the Panel tab, check Overlap Panels in the Horizontal Panel group.
- Go to Symbol tab, set Symbol Color: By Points: Increment from: to red color.
- Go to Panel tab. Select Between Panel from the Increment on Panel group.
- Trellis Display: Interview. Bell Labs web page: http://ect.bell-labs.com/sl/project/trellis/interview.html.