# Color data points in a plot according to column value

**URL:** <https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714>\
**Category:** W&B Help\
**Created:** [July 11, 2023, 8:43am UTC](https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714 "2023-07-11T08:43:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielglickman](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@danielglickman](https://community.wandb.ai/u/danielglickman)\
**Post date:** [July 11, 2023, 8:43am UTC](https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714/1 "2023-07-11T08:43:27Z")

</div>

I am running a sweep with parameters { method:[‘A’ , ‘B’], ratio: [0.1,.0.2,0.3,0.4,0.5] }  
I want to create a plot that contains the data from all the 2\*5=10 runs.  
The x axis should be the ratio and y axis is a metric I report at the end of each run.

This can be achieved easily with a scatter plot. What I am having trouble with is giving all the points with the same “method” column the same color. That is, I want all point with method A to have the one color and all with B to have another.  
Is there a way to do that?

---

<div class="post-metadata">

**Author:** ![luis\_bergua](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@luis\_bergua](https://community.wandb.ai/u/luis_bergua)\
**Post date:** [July 11, 2023, 11:29am UTC](https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714/2 "2023-07-11T11:29:29Z")

</div>

Hi @danielglickman, thanks for writing in! Would you mind sharing a link to the Workspace so I can provide you some examples of how to get that plot?

---

<div class="post-metadata">

**Author:** ![danielglickman](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@danielglickman](https://community.wandb.ai/u/danielglickman)\
**Post date:** [July 11, 2023, 5:13pm UTC](https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714/3 "2023-07-11T17:13:45Z")

</div>

Sure. Take a look here [Weights & Biases](https://wandb.ai/daniel-ai/pruning/sweeps/qv1s1jcq?workspace=user-danielglickman)  
at the ppl v. sparsity\_ratio panel. The colors of the points in the panel are “grouped by” prune\_method. I got this by manually setting the colors for each experiment. I want something similar but automatic.

---

<div class="post-metadata">

**Author:** ![luis\_bergua](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@luis\_bergua](https://community.wandb.ai/u/luis_bergua)\
**Post date:** [July 14, 2023, 3:03pm UTC](https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714/4 "2023-07-14T15:03:40Z")

</div>

Thanks for sharing this @danielglickman! I’d suggest to use a Weave panel as in the following screenshot since you can set the color to be `prune_method`

 ![image](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/5/58e8a925fcdc2591de23b447549d47d80df92591.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [September 12, 2023, 3:03pm UTC](https://community.wandb.ai/t/color-data-points-in-a-plot-according-to-column-value/4714/5 "2023-09-12T15:03:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
