# (Plots) how to set color of ticks?

**URL:** <https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974>\
**Category:** Visualization\
**Tags:** plots, gr\
**Created:** [December 19, 2024, 2:00am UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974 "2024-12-19T02:00:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [December 19, 2024, 2:00am UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/1 "2024-12-19T02:00:53Z")

</div>

How to set color of ticks?  
Not font or axis, only ticks.

Upd: using Plots.jl (gr backend)

Like this:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/7/e761bee02711fc0213cc010342b15e555e4d78a5.png)

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 19, 2024, 9:20am UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/2 "2024-12-19T09:20:56Z")

</div>

Using which plotting package?

---

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [December 19, 2024, 3:23pm UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/3 "2024-12-19T15:23:13Z")

</div>

Plots.jl (gr backend)

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 19, 2024, 3:44pm UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/4 "2024-12-19T15:44:45Z")

</div>

According to the docs that’s `foreground_color_axis`, although looking at

```julia
plot(rand(10), foreground_color_axis = :red)

```

that seems to change the color of all x and y axis ticks, whereas based on your image you just want to change some ticks? I think if that’s what you want to do it’s unlikely that there’s a keyword that can do this for you, you’re probably better off just trying to hack it by drawing over your plot?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 19, 2024, 8:47pm UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/5 "2024-12-19T20:47:52Z")

</div>

I agree with Nils and the hack will be easier for most Plots.jl backends, including `gr()`, if the ticks are inside the plotting boundaries.

For example:

 ![Plots_range_of_colored_tick_marks](https://global.discourse-cdn.com/julialang/original/3X/c/7/c71d9bd23e7e3289c5f259145ebf054de03bb962.png)

---

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [December 20, 2024, 11:25pm UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/6 "2024-12-20T23:25:11Z")

</div>

Thank you this works for me.

---

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [December 20, 2024, 11:26pm UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/7 "2024-12-20T23:26:27Z")

</div>

Yes, I understand how to do it inside plot. It’s fine just to make one color.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 20, 2024, 11:57pm UTC](https://discourse.julialang.org/t/plots-how-to-set-color-of-ticks/123974/8 "2024-12-20T23:57:51Z")

</div>

> [@PharmCat](#):
>
> It’s fine just to make one color.

You can then use as many colors as you want.
