using CairoMakie
x = range(0, 10, length=100)
y = sin.(x)
lines(x, y)
This code is copied from the official makie website
It is supposed to plot a basic sin function and display it in a new window. The code executes without throwing an error and when run in the REPL prints out the following:
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)
It does however not display anything. Neither when run in the REPL nor when run in a script. I am using a 2020 M1 Mac, MacOS Monterrey, Julia version 1.7
Why doesn't it show anything?
There is not a way to bring up a figure with CairoMakie from the REPL alone like Plots.jl can. From the CarioMakie tutorial: