# In Makie, how do I change the background for parts of the axis

**URL:** <https://discourse.julialang.org/t/in-makie-how-do-i-change-the-background-for-parts-of-the-axis/107136>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [December 5, 2023, 12:28am UTC](https://discourse.julialang.org/t/in-makie-how-do-i-change-the-background-for-parts-of-the-axis/107136 "2023-12-05T00:28:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Post date:** [December 5, 2023, 12:28am UTC](https://discourse.julialang.org/t/in-makie-how-do-i-change-the-background-for-parts-of-the-axis/107136/1 "2023-12-05T00:28:31Z")

</div>

I would like to change the background e.g. from x=a to x=b to purple, I can sort of use the [`band!`](https://docs.makie.org/stable/reference/plots/band/) to achieve the visual,

```julia
using GLMakie

ts = 0:0.01:2π
dat = sin.(ts)

fig = Figure()

ylims = extrema(dat) .+ (-0.1, 0.1)
ax = Axis(fig[1, 1], limits=((0, 2π), ylims))
lines!(ts, dat)
band!(π:0.01:2π, ylims[1], ylims[2], color=(:purple, 0.2))

fig

```

 ![makie_p](https://global.discourse-cdn.com/julialang/original/3X/2/a/2ab4fe5c5ddbb40cc38c1978eff8f804f2e51c5e.png)

But is there some better/less-hacky methods? Thanks!

---

<div class="post-metadata">

**Author:** ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Post date:** [December 5, 2023, 1:51am UTC](https://discourse.julialang.org/t/in-makie-how-do-i-change-the-background-for-parts-of-the-axis/107136/2 "2023-12-05T01:51:37Z")

</div>

Found the documentation

[https://docs.makie.org/stable/reference/plots/hvspan/#hspan\_and\_vspan](https://docs.makie.org/stable/reference/plots/hvspan/#hspan_and_vspan)
