---
title: Visualize Test Day Performance Trends with PLOT
slug: help/en-us/dairycomp/testdays-visual
docTags: 
createdAt: 2026-01-26T11:43:18.500Z
---

<font color="#67854E">**Question**</font>: How can I visualize and compare test day milk and component trends for individual animals or groups in DairyComp?

<font color="#67854E">**Answer**</font>: Use the PLOT command to visualize test day performance trends for individual animals or groups.

PLOT lets you display one or more numeric items (such as milk production or fat percentage) as curves on a graph or as raw data tables. You can also compare two groups on the same graph or break down results by categories like lactation group, cow breed, or test day pen. This function is helpful for analyzing production patterns, monitoring herd performance, and benchmarking different animal groups over time.

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/v676rstQPgk2f7uJhQNj-_graph-example.png" size="32" width="1509" height="662" darkWidth="1509" darkHeight="662" position="flex-start" showCaption="false"}

Unlike the [GRAPH](docId\:rhzbb3lbOEiOk_RlJsKu8) or [EGRAPH](docId\:Wz70PT9Vc4zc9r0pbK2dm) functions, which focus on items or events, PLOT is specifically designed for historical test day data. It can show trends across multiple tests, helping you understand changes in performance over time.

You can run the PLOT function using selection windows to choose the item(s) you want displayed. Alternatively, you can add parameters to the PLOT command directly in the command line.

::::ExpandableHeading
## Run PLOT using the Selection Windows

The easiest way to use the PLOT function is through selection windows that guide you through the process. To do so:

1. Enter PLOT in the command line.
   A window displays for selecting a test day item, such as MILK (milk production), PCTF (percent fat), or SCC (somatic cell count):


::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/HXjDqmH5fCl1g6XKPYAHW_select-window.png" size="32" width="382" height="173" darkWidth="382" darkHeight="173" position="flex-start" showCaption="false"}

2. Select the item you want to plot and click **OK**.
   A similar window appears asking you to select a second item.
3. Select the second item to plot and click **OK** (or press **Escape** to plot only one item).
4. Enter the applicable animal ID, then click **OK**.

After you enter the animal ID, the PLOT function generates a graph showing the selected item(s) across all recorded test days for that animal.

:::hint{type="success"}
**TIP:&#x20;**&#x49;f you want to skip the animal ID entry step, include the ID in your command. For example, PLOT` FOR ID=38` opens the item selection windows but does not prompt for animal ID.
:::
::::

:::ExpandableHeading
## Understanding the PLOT Output

An example PLOT graph is shown below, illustrating how the function displays test day data for an individual animal. In the example, MILK and PCTF were selected.

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/CZsAHvMvEJpGPRwSM8I-M_output-example.png" size="32" width="1278" height="696" darkWidth="1278" darkHeight="696" position="flex-start" showCaption="false"}

1. The **left vertical axis** shows the scale for the primary item (MILK, in pounds). In this specific view, this axis is displayed for reference.
2. The **right vertical axis** shows the scale for the secondary item (PCTF, percent fat). This is the item currently represented by the blue data line.
3. The **horizontal axis**, labeled TEST NUMBER, shows the sequence of recorded test days.
4. The blue **data line** represents the second item (PCTF) across test days. Each point corresponds to the animal's recorded fat percentage for that specific test.

When you select two items interactively, the graph defaults to showing the data line for the second item selected while keeping both axes for reference. To see both items as separate, simultaneous lines, you must use the command line or group plotting options described below.
:::

:::ExpandableHeading
## Adjusting Plot Settings with the Options Button

Once a graph is displayed, you don't need to exit and restart the command to change your view. Click the **Options** button in the upper-right corner of the graph screen to open the Options window.

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/oaZxS-1CC1qSxJ4s5ITQj_options-button.png" size="32" width="1518" height="801" darkWidth="1518" darkHeight="801" position="flex-start" showCaption="false"}

From this window, you can quickly adjust the following parameters:

- <font color="#67854E">**Change Items**</font>: Select a different numeric item to plot (e.g., switch from MILK to SCC or 305ME) without re-entering the command.
- <font color="#67854E">**Toggle Grouping\:**</font> Switch the horizontal axis between TEST NUMBER and TEST DATE \R.
- <font color="#67854E">**Filter by Lactation\:**</font> Check or uncheck specific lactation groups (e.g., LACT=1, LACT=2, or LACT>2) to show or hide their curves on the graph.
- <font color="#67854E">**Adjust Date Ranges**</font>: Manually enter a Start Date \D or End Date \E to focus on a specific time period.

After making your changes, click **Go** to instantly update the graph with your new settings.
:::

::::ExpandableHeading{customAnchorSlug="Plotting"}
## Plotting Groups and Advanced Options

You can use PLOT to analyze groups instead of individual animals. Add a `FOR` statement to filter the population. For example, the command PLOT` MILK PCTF FOR LACT=1` plots milk production for all first-lactation animals, producing a graph with two lines and a legend:

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/WdJDI-j3H5bxRpH3EeE02_output-example-two-lines.png" size="32" width="1512" height="664" darkWidth="1512" darkHeight="664" position="flex-start" showCaption="false"}

To compare two groups on the same graph, add a `WITH` statement. For example, PLOT` MILK FOR LACT=1 WITH LACT>1` plots first-lactation animals and overlays mature animals on the same graph:

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/KIeqQkI9ngkTaKF6ti3Mb_output-example-with.png" size="32" width="1515" height="662" darkWidth="1515" darkHeight="662" position="flex-start" showCaption="false"}

To break down results by category, add a `BY` statement. For example, PLOT` MILK BY LACT` displays multiple curves for each lactation group on one graph. You can also group by other items like cow breed or test day pen (e.g., TPEN).

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/ZOMq6smKo1M1mwn7tPjel_output-example-by.png" size="32" width="1553" height="637" darkWidth="1553" darkHeight="637" position="flex-start" showCaption="false"}

:::hint{type="info"}
**NOTE:&#x20;**&#x57;hen analyzing groups by pen, it is best to use test day pen (TPEN). While PEN refers to where the animal is standing today, TPEN identifies the pen the animal was actually in on that specific test day, ensuring your historical data stays accurate.
:::

You can use the `\Z` switch to show raw data tables instead of a graph (or simply click the **Grid** tab). These tables list the average values and the animal count (the number of animals included in that average) for each test day. This is often used for in-depth analysis where you need to see the specific numbers behind the curves.

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/vq95dI0DF6TOFV77Gyi0k_grid-example.png" size="32" width="1573" height="713" darkWidth="1573" darkHeight="713" position="flex-start" showCaption="false"}

:::hint{type="success"}
**TIP:&#x20;**&#x57;hen analyzing group averages, it is important to notice how many animals are contributing to each data point. As you look at later test numbers (such as test #10 and beyond), the number of cows in the group naturally decreases. Be cautious when interpreting averages based on a small subset of animals, as a few outliers can easily skew the results for the entire group.
:::
::::

:::ExpandableHeading
## Data Grouping

By default, PLOT groups data by test number (Test 1, Test 2, etc.). In this mode, the graph only includes active animals and their current lactation data.

To see herd-level trends over a chronological timeline, use the `\R` (Reverse axis) switch. This changes the horizontal axis from test numbers to actual test dates, allowing you to spot seasonal changes or evaluate overall herd performance over time.

Examples of Plotting by Date:

- PLOT` MILK\R`: Plots average milk production for the herd by test date.
- PLOT` MILK PCTF\R`: Plots milk and fat percentage together by test date.

Unlike the standard view, using the `\R` switch includes data from both live and dead/sold animals, as well as both current and previous lactations. This makes it a powerful tool for historical analysis. To narrow your focus to a specific historical period, combine it with the `\D` switch (e.g., PLOT` MILK\RD`) to prompt for a specific date range.
:::

:::ExpandableHeading
## Common Command Line Switches

You can combine multiple switches at the end of a command without spaces (for example, `\MRZ`). Common switches include:

- <font color="#67854E">**\\Z (Table mode)**</font>: Displays raw numeric data instead of a graph.
- <font color="#67854E">\:</font> Sets custom axis ranges for the graph.
- <font color="#67854E">**\\Y (Infection rates)\:**</font> When plotting SCC, breaks data into status groups.
- <font color="#67854E">**\\R (Reverse axis)\:**</font> Chronologically groups data by test date instead of test number and includes historical (dead/previous lactation) data.
- <font color="#67854E">**\\T (Tall mode)\:**</font> Increases the number of increments on the vertical axis (from 16 to 32).
- <font color="#67854E">**\\B (Blank lines)**</font>: Inserts blank lines between BY groups for easier reading.
- <font color="#67854E">**\\D (Dates)\:**</font> Prompts for a specific date range for the plot (useful for analyzing specific years or seasons).
- <font color="#67854E">**\\E (Ending date)\:**</font> Sets an ending date for the plot.
- <font color="#67854E">**\\L (Archived)\:**</font> Includes archived test data in the plot.
:::

