---
title: "The Z axis"
slug: "the-z-axis"
updated: 2025-09-11T13:05:09Z
published: 2025-09-11T13:05:09Z
canonical: "userguide.dataclassroom.com/the-z-axis"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://userguide.dataclassroom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The Z axis

The Z axis allows you to **add information from an additional variable** to the graph, either:

- Adding **color** (either shading by a numerical value in Z, or coloring by a category of Z)
- **Grouping** the samples according to a category of Z. (see [here](/v1/docs/grouping-by-a-z-variable))

(Sorry, it doesn't make a 3D graph. Yet.)

### 

## Adding more information by using a z variable:

Here is a simple example of a scatter plot, where a numerical Measurement on the Y axis is divided up into two groups on the X axis.

Let's say there was a third, numerical variable (column), Age, and we want to see how it relates to the other two. Add it (Age) as a **Z variable:**

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1617970839672.png)

Here is the result. In this case, you can clearly now see that Age and the Measurement are correlated:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/image-1617970686696.png)

A couple of things to note:

- The Z variable is now controlling the color, so the coloring due to the X group has been removed.
- The Z variable was **numeric**, so the color applied is a **linear shading**.

### Other ways a z-axis variable can enhance your graph:

![](https://cdn.document360.io/62f8f41e-e041-42c4-b9bc-8ae1eb45d064/Images/Documentation/Untitled%20drawing-21.png)

### Need even more details?

See also

Change the color scheme: [Visualizing Z variable using color](/v1/docs/coloring-by-categorical-z)

Add a regression line: [Multiple Lines using a Z variable](/v1/docs/multiple-lines-using-a-z-variable)

Separate the values for clearer evaluation: [Grouping dots by a Z variable](/v1/docs/grouping-by-a-z-variable)
