# Makie theme with transparent background not working

**URL:** <https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694>\
**Category:** Visualization\
**Tags:** question, makie\
**Created:** [December 22, 2025, 5:15pm UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694 "2025-12-22T17:15:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danieleavitabile](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danieleavitabile/32/31966_2.png) [@danieleavitabile](https://discourse.julialang.org/u/danieleavitabile)\
**Post date:** [December 22, 2025, 5:15pm UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694/1 "2025-12-22T17:15:33Z")

</div>

I would like to set once and for all the background of my axes and figures to be transparent. I thought I could do that as a theme in Makie.jl. The following minimal code fails to produce a transparent background

```julia-auto
using CairoMakie
CairoMakie.activate!()

theme = Theme(
  Figure = (backgroundcolor = :transparent,),
  Axis = (backgroundcolor = :transparent,)
)
set_theme!(theme)

fig = Figure()
ax = Axis(fig[1, 1])
lines!(ax, 1:10, rand(10))

save("transparent_test.svg", fig)

```

whereas the intrusive instructions

```julia-auto
fig = Figure(backgroundcolor = :transparent)
ax = Axis(fig[1, 1], backgroundcolor = :transparent)

```

work well.

Is there a way to setup the background transparency from a theme, or am I missing something?

---

<div class="post-metadata">

**Author:** ![raman\_kumar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raman_kumar/32/26782_2.png) [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Post date:** [December 22, 2025, 9:43pm UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694/2 "2025-12-22T21:43:36Z")

</div>

You should try

```julia-auto
theme = Theme(Axis = (backgroundcolor = :transparent))

```

see example in [Themes | Makie](https://docs.makie.org/dev/explanations/theming/themes#Theming-block-objects).

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [December 23, 2025, 12:02am UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694/3 "2025-12-23T00:02:24Z")

</div>

Block and plot objects can be themed by key, and `Figure` isn’t one of them, though I don’t know how specifying it could interfere. `Figure` doesn’t appear as a key in any of the [predefined themes](https://github.com/MakieOrg/Makie.jl/tree/master/Makie/src/themes), either. Try following `theme_dark` and `theme_black`’s examples by replacing the `Figure` entry with a direct `backgroundcolor = :transparent`, hopefully it gels with the `Axis`’ own transparency.

---

<div class="post-metadata">

**Author:** ![danieleavitabile](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danieleavitabile/32/31966_2.png) [@danieleavitabile](https://discourse.julialang.org/u/danieleavitabile)\
**Post date:** [December 23, 2025, 6:37am UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694/4 "2025-12-23T06:37:43Z")

</div>

Thank you, the solution was in the end to modify the theme as follows:

```julia-auto
theme = Theme(
  backgroundcolor = :transparent,
  Axis = (backgroundcolor = :transparent,)
)

```

---

<div class="post-metadata">

**Author:** ![danieleavitabile](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danieleavitabile/32/31966_2.png) [@danieleavitabile](https://discourse.julialang.org/u/danieleavitabile)\
**Post date:** [December 23, 2025, 6:39am UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694/5 "2025-12-23T06:39:20Z")

</div>

Thank you @raman_kumar for taking the time to answer. I’ve tried your solution but it was not working, because a field `backgroundcolor = :transparent` was needed in the main theme (outside axis, see below)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 23, 2025, 10:22am UTC](https://discourse.julialang.org/t/makie-theme-with-transparent-background-not-working/134694/6 "2025-12-23T10:22:49Z")

</div>

It’s for historical reasons, Scene was the only thing to theme at first so all its keys were top level. Figure is basically Scene so that stayed. Blocks and plot themes came later.
