# Plotting in Pluto with GLMakie

**URL:** <https://discourse.julialang.org/t/plotting-in-pluto-with-glmakie/137706>\
**Category:** New to Julia\
**Tags:** pluto, glmakie\
**Created:** [June 20, 2026, 5:38am UTC](https://discourse.julialang.org/t/plotting-in-pluto-with-glmakie/137706 "2026-06-20T05:38:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 20, 2026, 5:38am UTC](https://discourse.julialang.org/t/plotting-in-pluto-with-glmakie/137706/1 "2026-06-20T05:38:45Z")

</div>

I have a function that creates a Makie plot. I want it to display that plot by default, but to also return other information, let’s say `fig` and `ax`, so it can be called as `fig, ax = myplot(x)`. I’m using `show == true && display(fig)` in the function so as to have the option to avoid displaying the figure.  
So far everything is great so far, but the problem is how to make it easy to show the figure in Pluto as well. I know that `myplot(x)[1]` will do the trick, but would it be possible to show it with directly with `myplot(x)` or to find a more elegant solution?

Thanks!

---

<div class="post-metadata">

**Author:** ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)\
**Post date:** [June 20, 2026, 6:40am UTC](https://discourse.julialang.org/t/plotting-in-pluto-with-glmakie/137706/2 "2026-06-20T06:40:35Z")

</div>

Howdy, would just adding a semicolon to the end of your function call to suppress output work?

```julia
fig, ax = myplot(x);

```

and then in another cell:

```julia
fig # Display fig as usual

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [June 20, 2026, 8:29am UTC](https://discourse.julialang.org/t/plotting-in-pluto-with-glmakie/137706/3 "2026-06-20T08:29:50Z")

</div>

Makie does this same thing with the FigureAxisPlot type, it’s a single return value so `display` can work automatically once `show` is overloaded, but it also has an `iterate` overload so the `fig, ax, p = ...` thing works.

---

<div class="post-metadata">

**Author:** ![mahmah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mahmah/32/214326_2.png) [@mahmah](https://discourse.julialang.org/u/mahmah)\
**Post date:** [June 20, 2026, 9:16am UTC](https://discourse.julialang.org/t/plotting-in-pluto-with-glmakie/137706/4 "2026-06-20T09:16:36Z")

</div>

Thanks. I’m just trying to have something that easily works for students without a computational background. Maybe it helps to show the end of the function:

```julia-auto
p = meshscatter!(ax,X[framenum,:],Y[framenum,:],Z[framenum,:],markersize=msize,color=mcolor,colormap=mcolormap,clip_planes=Plane3f[])

…

show == true && display(fig)
return fig, ax, p, X, Y, Z, txt, conn, pl

```
