# Observable Plot: How to fix the color order?

**URL:** <https://talk.observablehq.com/t/observable-plot-how-to-fix-the-color-order/8422>\
**Category:** Help\
**Created:** [October 26, 2023, 6:26am UTC](https://talk.observablehq.com/t/observable-plot-how-to-fix-the-color-order/8422 "2023-10-26T06:26:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moon](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/moon/32/8216_2.png) [@moon](https://talk.observablehq.com/u/moon)\
**Post date:** [October 26, 2023, 6:26am UTC](https://talk.observablehq.com/t/observable-plot-how-to-fix-the-color-order/8422/1 "2023-10-26T06:26:56Z")

</div>

Hi, all  
When I filtered the data, I found that the colors of the same data were rendered first, while some colors were rendered later. How to fix the color order?  
Thank you for providing assistance in advance.  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/a/a8553bc52a12a433333abf03dd077d02d3ab0106.png)  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/8/81e74e13c741b1eee45f552ac1ffd9995d05cb7c.png)

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [October 26, 2023, 6:44am UTC](https://talk.observablehq.com/t/observable-plot-how-to-fix-the-color-order/8422/2 "2023-10-26T06:44:19Z")

</div>

It’s hard to tell from a screenshot. In general I’d recommend to create a first chart that gets all the colors, and reuse that chart’s [exposed color scale](https://observablehq.com/plot/features/plots#plot_scale) in the other charts.

---

<div class="post-metadata">

**Author:** ![moon](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/moon/32/8216_2.png) [@moon](https://talk.observablehq.com/u/moon)\
**Post date:** [October 26, 2023, 8:49am UTC](https://talk.observablehq.com/t/observable-plot-how-to-fix-the-color-order/8422/4 "2023-10-26T08:49:11Z")

</div>

I delved deeper and found that I can generate an array of data to be drawn, which can fix the order of colors. Thank you very much.
