using CairoMakie # CairoMakie.activate!(type = "svg") set_theme!() function example_plot() f = Figure() ax = Axis(f[1,1]) x = [1,3,9,5,2,1,1] y = [4,5,5,7,9,8,6] scatterlines!(ax, x) scatterlines!(ax, y) f end example_plot() first_theme = Theme(fontsize=12, resolution=(640,320)) set_theme!(first_theme) example_plot() cyberpunk_theme = Theme( # teal/cyan, pink, yellow, matrix green, red, violet palette = (color =["#08F7FE", "#FE53BB", "#F5D300", "#00ff41", :red, "#9467bd"],), backgroundcolor = "#212946", textcolor=:gray90, resolution=(640,320), fontsize=12, font = "Arial", colormap = :cool, cycle = Cycle([:color]), Axis = ( backgroundcolor = "#212946", topspinevisible = false, rightspinevisible = false, xgridcolor = "#2A3459", ygridcolor = "#2A3459", bottomspinecolor = "#2A3459", leftspinecolor = "#2A3459", ytickcolor = "#2A3459", xtickcolor = "#2A3459", titlesize=16, yautolimitmargin=(0.05, 0.1), # Leaves room for label text ), # Note in order to apply specific settings to plot types we need to use the Struct/type # so to theme barplots() you need to use the BarPlot type Lines = ( linewidth=2,), BarPlot = ( cycle=Cycle([:color]), # Interesting that I have to put it here label_size=12, ) ) with_theme(example_plot, cyberpunk_theme, ) set_theme!(cyberpunk_theme) n_lines = 10 diff_linewidth = 1.05 alpha_value = 0.03 f = Figure() ax = Axis(f[1,1]) colors = ["#08F7FE", "#FE53BB", "#F5D300", "#00ff41", :red, "#9467bd"] x = [1,3,9,5,2,1,1] y = [4,5,5,7,9,8,6] scatterlines!(ax, x) scatterlines!(ax, y) for n in 1:n_lines scatterlines!(ax, x; linewidth=2+(diff_linewidth*n), color = (colors[1], alpha_value)) scatterlines!(ax, y; linewidth=2+(diff_linewidth*n), color = (colors[2], alpha_value)) end f t = range(0, stop=1, length=500) # time steps θ = (6π) .* t # angles x = t .* cos.(θ) # x coords of spiral y = t .* sin.(θ) # y coords of spiral p1 = lines( x, y, color = t, # colormap = :cool, linewidth=8) y = round.(randn(5) .+ 2.5, digits=1) b = Figure() ax = Axis(b[1,1], title="Title") for i in 1:5 barplot!(ax, [i], [y[i]], bar_labels=[y[i]]) end b barplot(1:3, y[1:3], bar_labels=y[1:3], color=1:3, axis = (title="Barplot with continuous colormap",))