# Suppressing text output of display() of Makie

**URL:** <https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022>\
**Category:** General Usage\
**Created:** [November 24, 2021, 5:23pm UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022 "2021-11-24T17:23:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [November 24, 2021, 5:23pm UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022/1 "2021-11-24T17:23:46Z")

</div>

When I create a figure and display it with `Makie` like the following code:

```julia
using CairoMakie
fig = Figure()
...
display(fig)

```

I get a long list of text outputs like this:

```julia-repl
Scene (800px, 600px):
  108 Plots:
    ├ Combined{Makie.poly, Tuple{Vector{Vector{Point{2, Float32}}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{String}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{String}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
...

```

Is there a way to suppress this text output? I have other text outputs that summarize the results of calculation, and having to scrolling up to see those results is a nuisance.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [November 24, 2021, 10:13pm UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022/2 "2021-11-24T22:13:01Z")

</div>

Why do you need `display(fig)` with CairoMakie? What are you expecting to get? Is this on the REPL or on some other environment like jupyter?

If it is in jupyter/vscode and your purpose is to show the output image, you don’t need to do `display(fig)`, `fig` alone will suffice. If you want to suppress the output of `fig` you can add a semicolon, like `fig;`.

If this is in the REPL, CairoMakie cannot launch a window by itself, only save to disk.

---

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [November 24, 2021, 10:45pm UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022/3 "2021-11-24T22:45:55Z")

</div>

> [@aramirezreyes](#):
>
> Why do you need `display(fig)` with CairoMakie? What are you expecting to get? Is this on the REPL or on some other environment like jupyter?

I am using Atom/Juno IDE. AFAIK, we cannot open multiple windows for separate plots in `Makie` yet; see [this issue](https://github.com/JuliaPlots/Makie.jl/issues/188). However, in Atom/Juno you can actually do this; separate plot panes are created whenever you call `display(fig)`. Showing different plots in separate panes is very convenient. The only downside is that `display(fig)` generates many many lines of text output as described above.

Simply calling `fig` or `fig;` does not create separate plot panes in Atom/Juno.

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [November 25, 2021, 8:41am UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022/4 "2021-11-25T08:41:12Z")

</div>

This sounds like a bug: `display` is supposed to use only the “topmost applicable display in the display stack” and here it’s using two displays…

---

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [November 26, 2021, 8:41pm UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022/5 "2021-11-26T20:41:50Z")

</div>

I don’t think it is a bug. I think it is a feature of Atom/Juno. Whenever `display(...)` is called, a plot is drawn in the same window. However, Atom/Juno caches the previous plots, so I can browse through all the plots generated by `display(...)`.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 26, 2021, 9:48pm UTC](https://discourse.julialang.org/t/suppressing-text-output-of-display-of-makie/72022/6 "2021-11-26T21:48:35Z")

</div>

> [@sijo](#):
>
> This sounds like a bug: `display` is supposed to use only the “topmost applicable display in the display stack” and here it’s using two displays…

Makie is doing something weird here because it [overrides `display`](https://github.com/JuliaPlots/Makie.jl/blob/78820311c9b45347f0937caf8b31a25bbc27dd73/src/display.jl#L51-L62) and not just `show`, which is [not the recommended usage](https://docs.julialang.org/en/v1/manual/types/#man-custom-pretty-printing) and may compose poorly with environments using custom displays.
