CairoMakie wont display plots (running from terminal)

Not sure why… but I can’t get Makie plots to display. I’m running julia 1.6.1 from my terminal on PopOS 21.04.

The docs tell me that this is a backend build issue… but when I ran pkg> test CairoMakie, all tests passed. I also installed the packages suggsted here: sudo apt-get install ffmpeg cmake xorg-dev build-essential libglfw3 with no luck so far.

Anyone ran into similar issues to this before? I’m at a loss for what my next troubleshooting step should be.

using CairoMakie
x = range(0, 10, length=100)
y = sin.(x)
lines(x, y)

just outputs the structure of the figure object rather than displaying my plot in a new window.

julia> lines(x, y)
Scene (800px, 600px):
  18 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}}}}
    └ MakieCore.Text{Tuple{String}}
  1 Child Scene:
    └ Scene (728px, 541px)

In case its relevant, I never ran into any backend issues using Plots.jl so far. Any ideas?

What kind of output do you expect? Note that CairoMakie is for making SVG/PDF/PNG plots, which most terminals cannot display. GLMakie will display plots in a separate window. See also No plot with CairoMakie

1 Like

Yup, that was it.

I didn’t read this paragraph carefully enough in the basic tutorial.

To see the output of plotting commands when using CairoMakie… The Julia REPL by itself does not have the ability to show plots.

What got me really confused was when I looked at the FAQ, as it showed an output very similar to what I had but labelled as a symptom of a build issue. I then just assumed that displaying the data structure of the plot was a symptom of a build error.

Thanks for quickly clearing up this confusion for me!

1 Like