Changing the background color of a 3D Scene in Makie

I’m not sure what are you looking for but the following works just fine:

using GLMakie, ColorSchemes, Colors
# archimedean spiral
a, m, z₀ = 1, 2.1, 0
φ = LinRange(0,20π,500)
r = a*φ
x, y, z = r .* cos.(φ), r .* sin.(φ), m .* r .+ z₀;

set_theme!(backgroundcolor = :black)

fig = Figure(resolution = (500, 500))
ax = LScene(fig)
lines!(x, y, z, color = z, colormap = :viridis)
axis = ax.scene[OldAxis] # you can change more colors here!
axis[:ticks][:textcolor] = :white
fig[1, 1] = ax
#save("./results/FigBlack.png", fig, px_per_unit = 1)
fig

FigBlack
For more details you can take a look at this notebook.
https://nbviewer.jupyter.org/github/lazarusA/MakieNotebooks/blob/main/MakieBlack.ipynb

Best,
Lazaro

1 Like