Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change toolkit in Octave?

Tags:

plot

octave

My Octave crashes when I execute plot command. I found a solution in Assad Ebrahim's answer. He mentioned to switch the default toolkit to gnuplot, and change it in octave.rc file if I want to make the change permanently but I'm not clear about the permanent change in octaverc. When I open my octaverc with notepad++, it looks like this:

## System-wide startup file for Octave.
##
## This file should contain any commands that should be executed each
## time Octave starts for every user at this site.
EXEC_PATH (cstrcat (fullfile (OCTAVE_HOME, 'notepad++'), pathsep, 
EXEC_PATH));
EXEC_PATH (cstrcat (fullfile (OCTAVE_HOME, 'bin'), pathsep, EXEC_PATH));
EDITOR (fullfile (OCTAVE_HOME, 'notepad++', 'notepad++.exe'));

What should I change and how?

like image 520
Melinda W Avatar asked Apr 23 '17 10:04

Melinda W


1 Answers

First, the direct answer to your question is to append any command you want executed on startup to the end of the .octaverc file. So, to set a particular graphics toolkit you would add the line:

graphics_toolkit("gnuplot")

Or

graphics_toolkit("qt")

Or

graphics_toolkit("fltk")

For whichever toolkit you want.

Now, as pointed out by @Andy, if you are using Windows, it may be that you are misinterpreting a long delay for a crash. A still not entirely resolved windows bug concerns the fact that on the first plot Windows might need to create a font cache file. This can take a long time. Once this is complete, most subsequent plots will be much faster. Some info can be found about it at the following bug report page: https://savannah.gnu.org/bugs/?45458

EDIT: in the time since this answer was posted, the bug linked above has been largely resolved. Part of the installation process now updates the font-cache file. If using a zip package rather than an executable installer, there is a batch file that should be run after extracting octave to ensure that this is done. Details are available at: http://wiki.octave.org/Octave_for_Microsoft_Windows

like image 64
Nick J Avatar answered Nov 10 '22 03:11

Nick J