# State background

You can color the background of a time series plot based on the state or value of another signal.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FFgRz62wq6Ik7UeHUvaE1%2Fimage.png?alt=media&#x26;token=fe6d5af4-2136-43b9-aaf3-09bfdd9eb13a" alt="Conditional background in time series plots"><figcaption></figcaption></figure>

To configure background coloring:

1. Open the **plot settings** of your time series plot.
2. Drag or select a signal and add it to the **State background** section.
3. Define which states or values should correspond to which background colors.
4. The rules are applied **from top to bottom**—the background is colored according to the **first matching rule**.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2Ffx5HMxlbQ2p7fobzr9T1%2Fimage.png?alt=media&#x26;token=0fb55f73-ab28-4d75-a4ad-52f52c1ef129" alt="State background settings"><figcaption></figcaption></figure>
