# Custom scale in Plot?

**URL:** <https://talk.observablehq.com/t/custom-scale-in-plot/6815>\
**Category:** Help\
**Created:** [July 15, 2022, 2:04pm UTC](https://talk.observablehq.com/t/custom-scale-in-plot/6815 "2022-07-15T14:04:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcf](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@marcf](https://talk.observablehq.com/u/marcf)\
**Post date:** [July 15, 2022, 2:04pm UTC](https://talk.observablehq.com/t/custom-scale-in-plot/6815/1 "2022-07-15T14:04:12Z")

</div>

I’ve seen that in d3 you can do something like this to create a custom scale.  
`var scale = d3.scale.ordinal().domain(['senior','mid','junior']).range([0,1,2]);`

The goal is basically to specify a custom order on an axis.

How would I do this within a Plot bar chart?

---

<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:** [July 15, 2022, 2:26pm UTC](https://talk.observablehq.com/t/custom-scale-in-plot/6815/2 "2022-07-15T14:26:01Z")

</div>

You can specify the domain of an ordinal scale like so:  
`x: { domain: ['senior','mid','junior'] }`

and the domain order will be preserved

---

<div class="post-metadata">

**Author:** ![marcf](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@marcf](https://talk.observablehq.com/u/marcf)\
**Post date:** [July 15, 2022, 2:30pm UTC](https://talk.observablehq.com/t/custom-scale-in-plot/6815/3 "2022-07-15T14:30:49Z")

</div>

I hate it when I miss the documentation on small things like this. But yeah this is exactly what I needed so thanks again @Fil
