Struggling to display categorical data on your Grapher axes when your information isn't numeric? Grapher excels at visualizing numeric and date/time data. However, if your data is categorical (text-based) rather than numeric, you can still effectively represent it on your graphs. This page demonstrates how to leverage your worksheet category values to precisely label your axes, ensuring your graphs clearly communicate your non-numeric data.
Topics covered in this article: |
Data Organization for Categorical Axis Labels
To effectively use categorical labels on your Grapher axes, your data should be organized in a specific way. As illustrated in the example image below, your worksheet should contain two primary columns: one for your categorical data (e.g., text labels) and another for your numeric or date/time data that corresponds to each category. This layout ensures Grapher can properly associate your descriptive categories with their respective values for plotting.
Grouped Scatter Plots
Now that your data is correctly organized, we can begin creating the scatter plot. This initial plot will display the numeric values, we'll then customize the axis to display your descriptive category names for enhanced clarity.
- Open a new plot document. Then click the Home | New Graph | Line/Scatter | Scatter Plot command.
- Select the data file and click Open. The default graph is created using the only numeric column for both the X and Y axis.
- Click on the scatter plot in the Object Manager.
- In the Property Manager, select the Plot tab.
- In the Data section, for the Y variable field, click the drop down and select Sequence number.
- Verify that the X variable is set to Column B.
- In the Property Manager, select the Data Limits tab.
- In the Worksheet range section, adjust the First row and Last row field values to indicate where your data starts and stops.
- In the Object Manager, click Y Axis 1 to select it.
- In the Property Manager, select the Labels tab.
- In the General section, in the Label source field select From worksheet in the drop down.
- Click in the Worksheet field and select your data file from the list.
- Click in the Data variable field and select Sequence number from the list.
- Click in the Label variable field and select Column A from the list. Your graph should now contain categories for the X axis labels.
- Click the
button next to the Worksheet range to expand that section.
- Adjust the First row and Last row field values to indicate where your data starts and stops.
- In the Property Manager, select the Data Limits tab.
Grouped Bar Charts
Let's now create a bar chart using your organized data. A key advantage here is that Grapher automatically incorporates your category labels onto the axis by default, simplifying the initial setup.
- Click the Home | New Graph | Bar | Horizontal Category Bar Chart command.
- Select the data file and click Open.
- The default graph is created with the category labels automatically displayed.
Horizontal Grouped Box Plot
Proceeding with your organized data, we can now construct a Horizontal Grouped Box Plot. This plot type is excellent for comparing the spread and central tendency of numerical data across distinct groups, and Grapher automatically applies your categorical labels to the axis for immediate clarity.
- Click the Home | New Graph | Bar | Horizontal Category Box Plot command.
- Select the data file and click Open.
- The default graph is created with the category labels automatically displayed.
- In the Object Manager select the box plot layer,
- In the Property Manager, select the Plot tab.
- In the Data section, set the First variable and Last variable to span the number of groups you want to plot.
Comments
Please sign in to leave a comment.