# Issue: Passing \`scenekw\` Arguments in Makie Recipes

**URL:** <https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945>\
**Category:** General Usage\
**Tags:** plotting, makie\
**Created:** [August 29, 2025, 4:16pm UTC](https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945 "2025-08-29T16:16:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prittjam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/prittjam/32/21267_2.png) [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Post date:** [August 29, 2025, 4:16pm UTC](https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945/1 "2025-08-29T16:16:56Z")

</div>

I am unable to pass `scenekw` arguments through a Makie recipe such that the `LScene` is constructed correctly.  
Regardless of what I try, the result is always a perspective view with axes.

My understanding is that Makie recipes should handle this use case without requiring an `LScene` to be constructed beforehand.  
However, the macros obscure what is happening internally, making it difficult to diagnose.

Below is a minimal working example:

```julia
using GLMakie, TestImages

@recipe(ImShow) do scene
    Attributes(
        interpolate = false,
        camera = campixel!,
        show_axis = false
    )
end

Makie.args_preferred_axis(::Type{<: ImShow}, x) = Makie.LScene
Makie.preferred_axis_type(::ImShow) = Makie.LScene

function Makie.plot!(plt::ImShow)
    img = plt[1][]
    image!(plt, rotr90(img))
    return plt
end

img = testimage("cameraman")
image_size = reverse(size(img))

f2 = Figure(size = image_size, figure_padding = 0)
imshow(f2[1, 1], img)
display(f2)
```

---

<div class="post-metadata">

**Author:** ![prittjam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/prittjam/32/21267_2.png) [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Post date:** [August 29, 2025, 5:28pm UTC](https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945/2 "2025-08-29T17:28:00Z")

</div>

It seems a similar issue was raised here with no solution.

> [@Accessing LScene and Figure attributes from Makie Recipes](https://discourse.julialang.org/t/accessing-lscene-and-figure-attributes-from-makie-recipes/126320):
>
> Is it possible to access figure level or LScene level attributes from a Makie recipe? For example, in the MWE below, myplot(::MyTypeA) defaults to an LScene. Can I control show\_axis=false from within the recipe? I understand that fig, ax, mp = myplot(mytypea) ax.show\_axis[] = false would work but ideally I want this plot to have this default behavior. Similarly, setting the backlgroundcolor for an Axis plot (MyTypeB) from within the recipe seems impossible. module MyPackage export myplot, …

---

<div class="post-metadata">

**Author:** ![prittjam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/prittjam/32/21267_2.png) [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Post date:** [August 29, 2025, 5:55pm UTC](https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945/3 "2025-08-29T17:55:01Z")

</div>

Unfortunately I think that this needed use case pattern is not supported. There not so many recipe examples for this use case, however. But if the plot recipe is to create an LScene, it seems that we should be able to control how it is created, no?

---

<div class="post-metadata">

**Author:** ![prittjam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/prittjam/32/21267_2.png) [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Post date:** [September 1, 2025, 10:56am UTC](https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945/4 "2025-09-01T10:56:24Z")

</div>

I tried to solve this by creating a Theme which set Figure and Scene properties, but it fails as well:

```julia-auto
chart_theme = Theme(
    Figure(figure_padding=0,),
    Scene = (camera=campixel!,
             show_axis=false,)
)

```

Just using the Figure as an example results in the errror:

```julia-auto
chart_theme = Theme(
           Figure(figure_padding=0,),
       )
ERROR: MethodError: Cannot `convert` an object of type Figure to an object of type Dict{Symbol, Observable}
The function `convert` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  Dict{K, V}(::Any) where {K, V}
   @ Base dict.jl:90
  convert(::Type{T}, ::T) where T<:AbstractDict
   @ Base abstractdict.jl:571
  convert(::Type{T}, ::AbstractDict) where T<:AbstractDict
   @ Base abstractdict.jl:573
  ...

Stacktrace:
 [1] Attributes(attributes::Figure)
   @ MakieCore ~/.julia/packages/MakieCore/hXATT/src/types.jl:51
 [2] top-level scope
   @ REPL[68]:1
 [3] top-level scope
   @ none:1

```

So is it not possible to apply themes to Figure or Scenes with Makie recipes? There seems to be no way to uniformly control padding or rendering.

---

<div class="post-metadata">

**Author:** ![tonygem96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tonygem96/32/27564_2.png) [@tonygem96](https://discourse.julialang.org/u/tonygem96)\
**Post date:** [January 12, 2026, 7:13pm UTC](https://discourse.julialang.org/t/issue-passing-scenekw-arguments-in-makie-recipes/131945/5 "2026-01-12T19:13:45Z")

</div>

A simple workaround is to skip recipes entirely and instead write a function that explicitly constructs the plot the way you want. If this lives in a Makie extension, you retain essentially the same benefits. Most importantly, your package does not need to depend on Makie directly.

For example, in your case:

```julia
function some_plot(img)
    image_size = reverse(size(img))
    f2 = Figure(size = image_size, figure_padding = 0)
    scene = LScene(f2[1,1])
    imshow!(scene,img)
    campixel!(scene)
    scene.show_axis = false
    display(f2)
end

```
