# Makie alternating backends per plot

**URL:** <https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [March 3, 2023, 12:50pm UTC](https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496 "2023-03-03T12:50:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [March 3, 2023, 12:50pm UTC](https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496/1 "2023-03-03T12:50:18Z")

</div>

Is there a way to specify a makie backend per `Figure` ?

I know about `{WGL,Cairo,GL}Makie.activate!()` but that’s operating in a global fashion and it’s hard to operate/synchronize (especially for Pluto notebooks).

What I am imagining:

```julia
fgl = GLMakie.Figure()
scatter(fgl[1,1], 1:10)

fcm = CairoMakie.Figure()
scatter(fcm[1,1], 1:10)

fwgl = WGLMakie.Figure()
scatter(fwgl[1,1], 1:10)

```

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [March 7, 2023, 4:22am UTC](https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496/2 "2023-03-07T04:22:02Z")

</div>

I think you can `save(path, fig; backend = [WGL/GL/Cairo]Makie)` which is probably as close as you could get to something like this.

---

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [March 7, 2023, 9:13am UTC](https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496/3 "2023-03-07T09:13:49Z")

</div>

`save` will always write to a file and have a static representation. I would like to have the interactivity of GLMakie or WGLMakie.

---

<div class="post-metadata">

**Author:** ![asinghvi17](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asinghvi17/32/8272_2.png) [@asinghvi17](https://discourse.julialang.org/u/asinghvi17)\
**Post date:** [March 7, 2023, 3:38pm UTC](https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496/4 "2023-03-07T15:38:21Z")

</div>

You could `display([WGL/GL]Makie.Screen(scene))`, which should work fine.

---

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [March 8, 2023, 11:11am UTC](https://discourse.julialang.org/t/makie-alternating-backends-per-plot/95496/5 "2023-03-08T11:11:36Z")

</div>

testing with this ( [from scene tutorial](https://docs.makie.org/dev/tutorials/scenes/) ) :

```julia
julia> scene = Scene(backgroundcolor=:gray);

julia> subwindow = Scene(scene, px_area=Rect(100, 100, 200, 200), clear=true, backgroundcolor=:white);

julia> cam3d!(subwindow);

julia> scene = Scene(backgroundcolor=:gray);

julia> subwindow = Scene(scene, px_area=Rect(100, 100, 200, 200), clear=true, backgroundcolor=:white);

julia> cam3d!(subwindow);

julia> meshscatter!(subwindow, rand(Point3f, 10), color=:gray);

```

and

```julia
display(CairoMakie.Screen(scene))

```

```julia
display(GLMakie.Screen(scene))

```

```julia
display(WGLMakie.Screen(scene))

```

only the GLMakie version works.
