# change the color of axis rule lines

**URL:** <https://talk.observablehq.com/t/change-the-color-of-axis-rule-lines/7607>\
**Category:** Help\
**Created:** [February 7, 2023, 3:07pm UTC](https://talk.observablehq.com/t/change-the-color-of-axis-rule-lines/7607 "2023-02-07T15:07:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndrewStaroscik](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/andrewstaroscik/32/7443_2.png) [@AndrewStaroscik](https://talk.observablehq.com/u/AndrewStaroscik)\
**Post date:** [February 7, 2023, 3:07pm UTC](https://talk.observablehq.com/t/change-the-color-of-axis-rule-lines/7607/1 "2023-02-07T15:07:08Z")

</div>

In the plot below, the rule lines through the origins are black. Is there a way to change the color and stroke thickness of these lines?

```javascript
Plot.plot({
  grid: false,
  x: {
    domain: [-2,5],
    label: "x"
  },
  y: {
    domain: [-5,10],
    label: "y"
  },
  marks: [
    Plot.ruleY([0]),
    Plot.ruleX([0]),
    Plot.dot([{}], {x: 1, y: 1})
  ]
})

```

---

<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:** [February 7, 2023, 3:15pm UTC](https://talk.observablehq.com/t/change-the-color-of-axis-rule-lines/7607/2 "2023-02-07T15:15:31Z")

</div>

Sure! you can use any of the applicable common options: stroke (color), strokeOpacity, strokeWidth, and even strokeDasharray:

```auto
   Plot.ruleY([0], { strokeWidth: 0.5, strokeDasharray: "2 5" }),
   Plot.ruleX([0], { stroke: "red", strokeOpacity: 0.3 }),

```
