OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

Plotting Categorical Data


Categorical data are represented by discrete values. Such data are commonly dealt with in the biological and social sciences, examples being eye color or ranking. Origin recognizes two types of categorical data -- nominal (drug, eye color, etc.) and ordinal (performance, ranking, etc.).

Origin supports plotting of categorical data in both X and Y worksheet columns. Before plotting categorical data, you must identify your worksheet column data as Categorical data:

  1. Highlight the column.
  2. Select Column:Set as Categorical from the menu.
Image:Tip_icon.png

To decide whether to sort the tick labels in alphabetical order, please use system variable @CATS

Note: To have @CATS take effect, it must be set before the columns set as Categorical



Contents

 

X column is "Set as Categorical"

If your worksheet contains a categorical X column and one or more associated Y columns, Origin uses the X column values to create X axis tick labels. The tick marks evenly spaced along the X axis. The Y column values are plotted by X column category:

Image:Plotting Categorical Data1.pngImage:Plotting Categorical Data2.png

Y Column is "Set as Categorical"

If your worksheet contains a categorical Y column, you can map categories to such things as plot symbol shape, symbol color, symbol size, or other plot attributes as in the following example:

For example, in the following figure, the A(X) and B(Y) columns are plotted using the Scatter template.

Image:Plotting Categorical Data3.pngImage:Plotting Categorical Data4.png

To vary plot symbol by category (east, west), open the Symbol tab of the Plot Details dialog box and edit the Symbol Color and Shape drop-down lists as shown in the following figures.

Image:Plotting Categorical Data 03.png

The resulting graph (see the picture below) uses the column C categories to set both symbol color and shape. In doing so, Origin alphabetizes the categories (categories starting with numeric values are first). Because color indexing was selected, Origin assigns the first category to the first color in the color list, the second category to the second color, etc. Origin performs the same alphabetic assignment for any mapped plot attribute.

Image:Plotting Categorical Data5.pngImage:Plotting Categorical Data6.png

To add a legend to your graph layer that conveys information about the categorical data, select Graph: Enhanced Legend.

Also, seeLegends for Categorical Data Plots in the Origin Help file.