How to use default attributes of existing plot type in recipe definition in Makie 0.24?

Hi,

I am trying to update some Makie recipes to Makie 0.24. I would like to know how to get the default attributes of an existing plot type in the recipe definition, and possibly combine these attributes with local attributes for the new plot type.

I was doing this pre 0.24 like this:

(see the calls to default_theme and merge)

# Pre Makie 0.24
Makie.@recipe(MakiePlot) do scene
    t1 = Makie.Theme(
        dim = Makie.Automatic(),
        shrink = false,
        warp_by_vector = nothing,
        warp_by_scalar = nothing,
        warp_scale = 1,
        strokecolor = nothing,
        strokewidth = nothing,
        color      = :lightblue,
        colormap   = :bluesreds,
        shading    = Makie.NoShading,
        cycle      = nothing,
        refinement = nothing,
       )
    t2 = Makie.default_theme(scene, Makie.Mesh)
    merge(t1,t2)
end

Which would be the equivalent in Makie 0.24?

Thanks in advance!

cc @sdanisch @jules

1 Like

is this not working anymore?

Hi @sdanisch

In the new recipe macro signature I don’t know where to get the scene from:

# Makie 0.24
Makie.@recipe MakiePlot begin
    Makie.mixin_generic_plot_attributes()...
end

Any clue?

Ah you want to upgrade to the new recipe :wink:
I think you should be able to use Makie.documented_attributes(Mesh)....

2 Likes

It works, thanks!