# How to set data which are in the same group has the same palette color in \`RecipesBase.jl\`?

**URL:** <https://discourse.julialang.org/t/how-to-set-data-which-are-in-the-same-group-has-the-same-palette-color-in-recipesbase-jl/92785>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [January 11, 2023, 2:07am UTC](https://discourse.julialang.org/t/how-to-set-data-which-are-in-the-same-group-has-the-same-palette-color-in-recipesbase-jl/92785 "2023-01-11T02:07:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![singularitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singularitti/32/17678_2.png) [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Post date:** [January 11, 2023, 2:07am UTC](https://discourse.julialang.org/t/how-to-set-data-which-are-in-the-same-group-has-the-same-palette-color-in-recipesbase-jl/92785/1 "2023-01-11T02:07:58Z")

</div>

It is similar to the following question:  
[How to set colours for groups of elements on a plot - New to Julia - Julia Programming Language](https://discourse.julialang.org/t/how-to-set-colours-for-groups-of-elements-on-a-plot/25050)  
For example, I have two groups of data: one is labeled as “22” and one is labeled as “8”. Each group contains more than one data points. How do I make those data points which are in the same group to have the same color? I want to change the number of groups in the future, so I wish I can dynamically generate a series of colors and use them on my groups.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/d/9dfab058fc08bd83bed719df29e05a1d2b4936f8.jpeg)

The relevant code is [here](https://github.com/MineralsCloud/CrystallographyRecipes.jl/blob/4e7e5b60f67b03efbee8761c4b576d3236608631/src/recipes.jl#L36-L52).
