Octave for making fig for LaTeX

I am trying to make a file with .tex suffix (to be used as a figure for latex) via the code below by octave 5.2.0:
print -depslatex -mono "-S800,600" "kelvin-fig.tex"

but I encounter this error:

error: print: figure must be visible or qt toolkit must be used with __gl_window__ property 'on' or QT_OFFSCREEN feature available
error: called from
    __opengl_print__ at line 195 column 7
    print at line 710 column 16

Any help is appreciated.

It looks like you are trying to print a figure while it is invisible. The simplest workaround is to set the figure visible prior to printing : set (gcf, "visible", "on").

What does graphics_toolkit return?

  • fltk: it is a known issue that it doesn’t handle offscreen printing.
  • qt: it looks like Octave has been built against an old version of Qt that doesn’t support Offscreen rendering.
1 Like

Thanks a lot, the said code solved my issue.
set (gcf, "visible", "on")
P.S. graphics_toolkit returns fltk.