MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.39k stars 302 forks source link

No GUI showing on MacOS #263

Closed asinghvi17 closed 5 years ago

asinghvi17 commented 5 years ago

When used either on the REPL or in Juno on MacOS (version 10.14.1), no GUI opens for any Makie plots. Using Plots.jl works fine, but for some reason the only thing that happens when I try to plot anything is that some information about the Scene is printed. An example is below:

julia> using Makie
julia> sc = Scene()
Scene (960px, 540px):
events:
    window_area: GeometryTypes.HyperRectangle{2,Int64}([0, 0], [0, 0])
    window_dpi: 100.0
    window_open: false
    mousebuttons: Set(AbstractPlotting.Mouse.Button[])
    mouseposition: (0.0, 0.0)
    mousedrag: notpressed
    scroll: (0.0, 0.0)
    keyboardbuttons: Set(AbstractPlotting.Keyboard.Button[])
    unicode_input: Char[]
    dropped_files: String[]
    hasfocus: false
    entered_window: false
plots:
subscenes:

julia> heatmap!(sc, rand(50, 50))
Scene (960px, 540px):
events:
    window_area: GeometryTypes.HyperRectangle{2,Int64}([0, 0], [0, 0])
    window_dpi: 100.0
    window_open: false
    mousebuttons: Set(AbstractPlotting.Mouse.Button[])
    mouseposition: (0.0, 0.0)
    mousedrag: notpressed
    scroll: (0.0, 0.0)
    keyboardbuttons: Set(AbstractPlotting.Keyboard.Button[])
    unicode_input: Char[]
    dropped_files: String[]
    hasfocus: false
    entered_window: false
plots:
   *Axis2D{...}
   *Heatmap{...}
subscenes:
   *scene(960px, 540px)

The packages installed are:

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`
  [537997a7] AbstractPlotting v0.9.1 #master (https://github.com/JuliaPlots/AbstractPlotting.jl.git)
  [c7e460c6] ArgParse v0.6.1
  [c52e3926] Atom v0.7.11
  [ad839575] Blink v0.9.0
  [631607c0] CMake v1.1.0
  [a2cac450] ColorBrewer v0.4.0
  [5ae59095] Colors v0.9.5
  [0c46a032] DifferentialEquations v5.3.1
  [31c24e10] Distributions v0.16.4
  [7876af07] Example v0.5.1
  [5789e2e9] FileIO v1.0.4
  [e9467ef8] GLMakie v0.0.1 #master (https://github.com/JuliaPlots/GLMakie.jl.git)
  [c91e804a] Gadfly v1.0.1
  [4d00f742] GeometryTypes v0.7.2
  [f67ccb44] HDF5 v0.10.3
  [7073ff75] IJulia v1.14.1
  [6a3955dd] ImageFiltering v0.5.1
  [6218d12a] ImageMagick v0.7.1
  [916415d5] Images v0.17.0
  [d0351b0e] InspectDR v0.3.3
  [c601a237] Interact v0.9.0
  [e5e0dc1b] Juno v0.5.3
  [b964fa9f] LaTeXStrings v1.0.3
  [ee78f7c6] Makie v0.9.0 #master (https://github.com/JuliaPlots/Makie.jl.git)
  [7269a6da] MeshIO v0.3.1
  [47be7bcc] ORCA v0.2.0
  [3b7a836e] PGFPlots v3.0.1
  [9b87118b] PackageCompiler v0.5.1
  [ccf2f8ad] PlotThemes v0.3.0
  [58dd65bb] Plotly v0.2.0
  [f0f68f2c] PlotlyJS v0.12.1
  [91a5bcdd] Plots v0.22.0
  [92933f4c] ProgressMeter v0.8.0
  [438e738f] PyCall v1.18.5
  [d330b81b] PyPlot v2.6.3
  [dca85d43] QuartzImageIO v0.5.0
  [af85af4c] RowEchelon v0.1.1
  [60ddc479] StatPlots v0.8.2
  [2913bbd2] StatsBase v0.26.0
  [24249f21] SymPy v0.8.3
  [b8865327] UnicodePlots v0.3.1
  [44cfe95a] Pkg

The same error occurs in IJulia when I try to use Makie in a Jupyter notebook.

I would greatly appreciate any help in this matter.

SimonDanisch commented 5 years ago

Did you also load Plots.jl? Might be that they fight over the display!

asinghvi17 commented 5 years ago

No, Plots.jl wasn't loaded. Could it be that I'm missing a package or something?

SimonDanisch commented 5 years ago

I can't reproduce... you seem to be on master for GLMakie, Makie, AbstractPlotting...maybe make sure, that all are on fresh master, and not on differently old versions of master?

utotch commented 5 years ago

My env is different from yours but I encountered the same situation. In my case, an installation failure of GLMakie caused the problem. (Since my env is headless env, GLMakie was not properly installed.)

a solution in my case is

$ export $DISPLAY=:0 # important for headless env
] build GLMakie

myenv:

Julia Version 1.0.2 Commit d789231e99 (2018-11-08 20:11 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.0 (ORCJIT, skylake) Environment: JULIA_DEPOT_PATH = /opt/share/julia

SimonDanisch commented 5 years ago

yeah if glmakie doesn't install - you dont get any backend, so it doesn't display anything.. you can use cairomakie in that case

asinghvi17 commented 5 years ago

Yep, GLMakie was hitting a bug where it didn't recognize the OpenGL drivers. The solution was not, unfortunately, in the form of an OS update, but instead when I switched to my Windows partition and installed Makie there after an update of graphics drivers it worked fine (on Windows and MacOS both). Updating the system did nothing, so I suspect that the OpenGL frameworks may not have been playing nice with the particular version of graphics drivers that I had, and that updating the graphics card's drivers from Windows fixed that somehow.

There seems to be no easy fix for this, and the average Mac user probably doesn't have another OS handy on their machine, so beyond updating the card from another OS I'm not sure what can be done if anyone else encounters this issue.

SimonDanisch commented 5 years ago

are you sure you're not just running into: https://github.com/JuliaPlots/GLMakie.jl/pull/7

SimonDanisch commented 5 years ago

or rather the issue: https://github.com/JuliaPlots/GLMakie.jl/issues/5

asinghvi17 commented 5 years ago

Yep, that looks like it. Thanks for the help!