Engee 文档

预定义主题

该页面正在翻译中。

Makie有一些预定义的主题。 在这里,您可以看到应用了这些不同主题的相同示例图。

using CairoMakie
using Random


function demofigure()
    Random.seed!(2)

    f = Figure()
    ax = Axis(f[1, 1],
        title = "measurements",
        xlabel = "time (s)",
        ylabel = "amplitude")

    labels = ["alpha", "beta", "gamma", "delta", "epsilon", "zeta"]
    for i in 1:6
        y = cumsum(randn(10)) .* (isodd(i) ? 1 : -1)
        lines!(y, label = labels[i])
        scatter!(y, label = labels[i])
    end

    Legend(f[1, 2], ax, "legend", merge = true)

    Axis3(f[1, 3],
        viewmode = :stretch,
        zlabeloffset = 40,
        title = "sinusoid")

    s = surface!(0:0.5:10, 0:0.5:10, (x, y) -> sqrt(x * y) + sin(1.5x))

    Colorbar(f[1, 4], s, label = "intensity")

    ax = Axis(f[2, 1:2],
        title = "different species",
        xlabel = "height (m)",
        ylabel = "density",)
    for i in 1:6
        y = randn(200) .+ 2i
        density!(y)
    end
    tightlimits!(ax, Bottom())
    xlims!(ax, -1, 15)

    Axis(f[2, 3:4],
        title = "stock performance",
        xticks = (1:6, labels),
        xlabel = "company",
        ylabel = "gain (\$)",
        xticklabelrotation = pi/6)
    for i in 1:6
        data = randn(1)
        barplot!([i], data)
        rangebars!([i], data .- 0.2, data .+ 0.2)
    end

    f
end

demofigure(具有1方法的泛型函数)

默认主题

</无翻译>

demofigure()
ef63189

主题_ggplot2

</无翻译>

with_theme(demofigure, theme_ggplot2())
1324f63

最小;最小

</无翻译>

with_theme(demofigure, theme_minimal())
3e5a00e

[医]黑色

</无翻译>

with_theme(demofigure, theme_black())
af4ae60

[医]灯

</无翻译>

with_theme(demofigure, theme_light())
bdf5966

主题_dark

</无翻译>

with_theme(demofigure, theme_dark())
7e41e67

主题_latexfonts

请参阅 关于Makie和LaTeX的更多一般文档</无翻译>

with_theme(demofigure, theme_latexfonts())
6170618