Octave freeze when it needs to plot

I had to update octave from 4.4.0 to the latest version 5.2.0 to get out of this. But I still can't figure out why the previous version misbehaved in the first place.


I noticed when I enter command available_graphics_toolkits it only shows

ans =

{

[1,1] = gnuplot

}

and wheh I try with loaded_graphics_toolkits, it prints

ans = {}(1x0)

I guesed problem was with not loading GUI environment, so Octave was then recompiled with --with-gui option

brew reinstall octave --with-gui

and that solved a problem.

Update

According to this commit, from last September, version 4.2.0-rc2, --with-gui does not work anymore. So the best it to follow the instruction from Konstantin.


The first plot after starting Octave 4 can last a while.

Reference: http://wiki.octave.org/Octave_for_MacOS_X


The accepted answer from miller didn't work for me, although available_graphics_toolkits and loaded_graphics_toolkits returned similar results. The octave package doesn't seem to have a --with-gui flag anymore.

Instead what I had to do to get it working was first brew reinstall gnuplot --with-x11 and then create a ~/.octaverc with the content

setenv("GNUTERM", "X11")
graphics_toolkit("gnuplot")

I did have X11 preinstalled.