FAQ: Difference between revisions

Jump to navigation Jump to search
2,939 bytes added ,  17 December 2016
Update some outdated links.
(→‎How do I make Octave use more precision?: remove note about symbolic being useless. It's currently working fine via sympy)
(Update some outdated links.)
(26 intermediate revisions by 14 users not shown)
Line 1: Line 1:
This is a list of frequently asked questions (FAQ) for GNU Octave users.
This is a list of frequently asked questions (FAQ) for GNU Octave users.


We are always looking for new questions (with answers), better answers, or both. Feel free to edit this page with your changes. If you have general questions about GNU Octave, or need help for something that is not covered by the Octave manual or the FAQ, please use the [https://mailman.cae.wisc.edu/listinfo/help-octave help@octave.org mailing list].
We are always looking for new questions (with answers), better answers, or both. Feel free to edit this page with your changes. If you have general questions about GNU Octave, or need help for something that is not covered by the Octave manual or the FAQ, please use the [https://lists.gnu.org/mailman/listinfo/help-octave help@octave.org mailing list].


This FAQ is intended to supplement, not replace, the GNU Octave manual. Before posting a question to the [https://mailman.cae.wisc.edu/listinfo/help-octave help@octave.org mailing list], you should first check to see if the topic is covered in the manual.
This FAQ is intended to supplement, not replace, the GNU Octave manual ([https://www.gnu.org/software/octave/doc/interpreter/ HTML], [https://www.gnu.org/software/octave/octave.pdf PDF]). Before posting a question to the [https://lists.gnu.org/mailman/listinfo/help-octave help@octave.org mailing list], you should first check to see if the topic is covered in the manual.
 
<div class="tocinline">__TOC__</div>


=General=
=General=
Line 18: Line 20:


==What is Octave-Forge?==
==What is Octave-Forge?==
[http://octave.sourceforge.net/ Octave-Forge] is a collection of packages for GNU Octave, something similar to the Matlab toolboxes. When talking about the two projects at the same time, GNU Octave is usually referred to as Octave core (or just ''core''). [http://octave.sourceforge.net/ Octave-Forge] also serves as a test bed for code that may eventually end up in the core, and distributes binaries for systems with a lack of developers tools (mainly Windows).
 
[https://octave.sourceforge.io/ Octave-Forge] is a collection of packages for GNU Octave, something similar to the Matlab toolboxes. When talking about the two projects at the same time, GNU Octave is usually referred to as Octave core (or just ''core''). [https://octave.sourceforge.io/ Octave-Forge] also serves as a test bed for code that may eventually end up in the core, and distributes binaries for systems with a lack of developers tools (mainly Windows).


==Who uses Octave?==
==Who uses Octave?==
Line 59: Line 62:


Octave is also free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation, or at your option any later version.
Octave is also free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation, or at your option any later version.
==Why are the developers planning to replace Gnuplot with an OpenGL backend?==
The development of Octave is committed to being both compatible with Matlab and adding additional features. Toward those ends, the development community has chosen to introduce a native OpenGL backend that supports Matlab handle graphics and its uicontrols. Starting with the 3.8 release, Octave now uses OpenGL graphics by default with FLTK widgets. A Qt OpenGL toolkit is also [https://github.com/goffioul/QtHandles under development].
There are no plans to remove the gnuplot backend. While a better backend may some day become the new default plotter, the gnuplot backend will still be available as long as our users find it useful.


== How can I cite Octave? ==
== How can I cite Octave? ==
Line 212: Line 209:
* First official release of the GUI.
* First official release of the GUI.
* Release of official windows binaries.
* Release of official windows binaries.
* Experimental support for classdef.
* Experimental support for [[classdef]].
* OpenGL graphics with Qt widgets.
* OpenGL graphics with Qt widgets.
* Several functions for reading, writing, and recording of audio.
* Several functions for reading, writing, and recording of audio.
Line 312: Line 309:


* http://www.octave.org/download.html
* http://www.octave.org/download.html
* ftp://ftp.octave.org/pub/octave/
* https://ftp.gnu.org/gnu/octave/


Since Octave is distributed under the terms of the GPL, you can get Octave from a friend who has a copy, or from the Octave website.
Since Octave is distributed under the terms of the GPL, you can get Octave from a friend who has a copy, or from the Octave website.
Line 326: Line 323:
* http://www.octave.org/download.html
* http://www.octave.org/download.html


As of today, Octave binaries are available at least on Debian, Ubuntu, RedHat, Suse, and Fedora GNU/Linux; Mac OS X; and Windows (versions 98, 2000, XP, Vista, 7 and 8).
As of today, Octave binaries are available at least on Debian, Ubuntu, RedHat, Suse, and Fedora GNU/Linux; Mac OS X; and Windows (versions 98, 2000, XP, Vista, 7, 8, and 10).


==How do I get a copy of Octave for (some other platform)?==
==How do I get a copy of Octave for (some other platform)?==
Line 354: Line 351:
Yes, but development is done primarily with GCC, so you may hit some incompatibilities. Octave is intended to be portable to any standard conforming compiler. If you have difficulties that you think are bugs, please report them to the http://bugs.octave.org bug tracker, or ask for help on the [mailto:help@octave.org mailing list].
Yes, but development is done primarily with GCC, so you may hit some incompatibilities. Octave is intended to be portable to any standard conforming compiler. If you have difficulties that you think are bugs, please report them to the http://bugs.octave.org bug tracker, or ask for help on the [mailto:help@octave.org mailing list].


== How do I install ''all'' Octave packages? ==
== How do install or load all Octave packages? ==
Do not do it! Really, there is no reason to do this. Octave Forge has many packages for different needs but it's unlikely that you need all of them. The common misconception is that the more packages one installs, the more complete and powerful its octave installation will be. However, in the same way one would ''never'' install all perl modules, ruby gems or python packages (because it simply makes no sense), one should not install all octave packages. This isn't desirable and it's not even possible.
 
Do not do it! Really, there is no reason to do this. Octave has many
packages for different needs and is unlikely that you need all of
them. You either have a small set of required packages, in which case
you know them by name; or you want them all "just because", in which case
you don't really need them.
 
The common misconception is that the more packages one has installed
and loaded, the more complete and powerful its Octave installation will be.
However, in the same way one would never install all perl modules,
ruby gems, python packages, and C++ libraries (because it simply makes
no sense), one should not install all Octave packages.
 
Packages should be installed and loaded selectively.  Note that some
packages are meant to shadow core functions changing the way Octave works,
and that different packages can have different functions with the same name
leading to unpredictable results.
 
If you really really really want to do load all packages, you can with
the following:
 
## WARNING: loading all packages is probably not the solution you are looking for.
cellfun (@(x) pkg ("load", x.name), pkg ("list"));


Packages should be installed and loaded selectively. Note that some packages are meant to shadow core functions changing the way Octave works, and different packages can have different implementations of a function with the same name, leading to unpredictable results. Others are just broken or crappy and will break your system. What's worse, some of them packages are even loaded automatically at startup so you may be screwing your octave installation without even realizing it.
 
== How do I automatically load a package at Octave startup? ==
 
When Octave starts, it runs {{Path|~/.octaverc}}.  If you want Octave to
automatically load a package, simply add a {{codeline|pkg load pkg-name}}
command to it. If the files does not exist, create it.
 
If you do this, remember that other people may not have Octave configured
to load packages at startup.  Therefore, if you write code for others,
remember that your programs still need to load the packages they require.


=Coding=
=Coding=
Line 378: Line 406:


As a natural extension of this, functions can also be defined in script files (m-files whose first non-comment line isn't {{Codeline|function out &#61; foo (...)}})
As a natural extension of this, functions can also be defined in script files (m-files whose first non-comment line isn't {{Codeline|function out &#61; foo (...)}})
Note: MATLAB R2016b added the ability to [http://www.mathworks.com/help/matlab/matlab_prog/local-functions-in-scripts.html define functions in script files].


===Comments with #===
===Comments with #===
Line 456: Line 486:
     x += 1;
     x += 1;
   until (x == 10)
   until (x == 10)
===Broadcasting===
Borrowed from [http://stackoverflow.com/q/26948776/3565696 other languages], [http://www.gnu.org/software/octave/doc/v4.0.1/Broadcasting.html octave broadcasting] allows easy and readable vectorization.
  f = (1:0.1:2);
  # put angular frequencies on the first dimension to prepare broadcasting
  omega = 2 * pi * f(:);
  # time is already on the second dimension (row vector)
  t = 0:0.02:2;
  # the resulting s will be a 2-dimensional array
  s = sin(omega .* t);
  # which can be displayed as
  pcolor(t, f, s)
  xlabel("t (s)")
  ylabel("f (Hz)")
Note: [https://www.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-operations.html Automatic expansion of dimensions] was added to MATLAB R2016b.


==How does Octave solve linear systems?==
==How does Octave solve linear systems?==
Line 599: Line 647:


Consider carefully if your problem really needs more precision. Often if you're running out of precision the problem lies fundamentally in your methods being [http://en.wikipedia.org/wiki/Numerical_stability numerically unstable], so more precision will not help you here. If you absolutely must use arbitrary-precision arithmetic, you're at present better off using a CAS instead of Octave. An example of such a CAS is [http://sagemath.org Sage].
Consider carefully if your problem really needs more precision. Often if you're running out of precision the problem lies fundamentally in your methods being [http://en.wikipedia.org/wiki/Numerical_stability numerically unstable], so more precision will not help you here. If you absolutely must use arbitrary-precision arithmetic, you're at present better off using a CAS instead of Octave. An example of such a CAS is [http://sagemath.org Sage].
==How do I run a Matlab P-file in Octave?==
You can't. Matlab P-files (files with a .p file extension), also known as P-code, are [https://en.wikipedia.org/wiki/Obfuscation_%28software%29 obfuscated] files than cannot be run outside of Matlab itself. The original source Matlab m-files that were used to generate the P-files should be used in Octave instead.
There are no plans to support running P-files produced by Matlab in Octave.


=Common problems=
=Common problems=
Line 653: Line 707:
== I have installed a package but still get a "foo undefined" error ==
== I have installed a package but still get a "foo undefined" error ==


You have probably forgotten to load the package. Use {{Codeline|pkg load package-name}} to load it. Most packages are no longer loaded automatically to avoid surprises. See reasoning on related FAQ [[FAQ#How_do_I_install_all_Octave_packages.3F|how do I install all Octave packages]]. If you want a specific package to be loaded by default at startup, consider adding the {{Codeline|pkg load}} command on your {{path|.octaverc}} file.
You have probably forgotten to load the package. Use {{Codeline|pkg load package-name}} to load it. Most packages are no longer loaded automatically to avoid surprises. See reasoning on related FAQ [[FAQ#How_do_I_install_all_Octave_packages.3F|how do I install all Octave packages]]. If you want a specific package to be loaded by default at startup, consider adding the {{Codeline|pkg load}} command on your {{path|[[.octaverc]]}} file.


== Missing lines when printing under Windows with OpenGL toolkit and Intel integrated GPU ==
== Missing lines when printing under Windows with OpenGL toolkit and Intel integrated GPU ==
Line 663: Line 717:
See also https://www.opengl.org/wiki/FAQ#Why_is_my_GL_version_only_1.4_or_lower.3F
See also https://www.opengl.org/wiki/FAQ#Why_is_my_GL_version_only_1.4_or_lower.3F


=Porting programs from Matlab to Octave=
== Plot hangs and makes the GUI unresponsive ==
 
If the Qt graphics toolkit is used and "plot" is used for the first time, the fontconfig scanner searches the font directory to build a font cache. This can take up to 3min on slow CPUs. See {{bug|45458}}
 
= Differences between Octave and Matlab =


People often ask
People often ask
Line 685: Line 743:
You should also look at the pages http://octave.sourceforge.net/packages.php and http://octave.sourceforge.net/docs.html that have a function reference that is up to date. You can use this function reference to see the number of octave functions that are available and their Matlab compatibility.
You should also look at the pages http://octave.sourceforge.net/packages.php and http://octave.sourceforge.net/docs.html that have a function reference that is up to date. You can use this function reference to see the number of octave functions that are available and their Matlab compatibility.


==How is Octave different from Matlab?==
== Nested Functions ==
 
The major differences between Octave 3.4.N and Matlab R2010b are:
 
===Nested Functions===
Octave has limited support for nested functions. That is
Octave has limited support for nested functions. That is


Line 712: Line 766:
The authors of Octave consider the nested function scoping rules of Matlab to be more problems than they are worth as they introduce difficult to find bugs as inadvertently modifying a variable in a nested function that is also used in the parent is particularly easy for those not attentive to detail.
The authors of Octave consider the nested function scoping rules of Matlab to be more problems than they are worth as they introduce difficult to find bugs as inadvertently modifying a variable in a nested function that is also used in the parent is particularly easy for those not attentive to detail.


===Differences in core syntax===
== Differences in core syntax ==


There are a few core Matlab syntaxes that are not accepted by Octave, these being
There are a few core Matlab syntaxes that are not accepted by Octave, these being
Line 722: Line 776:
* Matlab classdef object oriented programming is not yet supported, though work is underway in a branch of the development tree.
* Matlab classdef object oriented programming is not yet supported, though work is underway in a branch of the development tree.


===Differences in core functions===
== Differences in core functions ==


A large number of the Matlab core functions (ie those that are in the core and not a toolbox) are implemented, and certainly all of the commonly used ones. There are a few functions that aren't implemented, usually to do with specific missing Octave functionality (GUI, DLL, Java, ActiveX, DDE, web, and serial functions). Some of the core functions have limitations that aren't in the Matlab version. For example the sprandn function can not force a particular condition number for the matrix like Matlab can.
A large number of the Matlab core functions (ie those that are in the core and not a toolbox) are implemented, and certainly all of the commonly used ones. There are a few functions that aren't implemented, usually to do with specific missing Octave functionality (GUI, DLL, Java, ActiveX, DDE, web, and serial functions). Some of the core functions have limitations that aren't in the Matlab version. For example the sprandn function can not force a particular condition number for the matrix like Matlab can. Another example is that testing and the runtests function work differently in Matlab and Octave.


===Just-In-Time compiler===
== Just-In-Time compiler ==


Matlab includes a "Just-In-Time" compiler. This compiler allows the acceleration of for-loops in Matlab to almost native performance with certain restrictions. The JIT must know the return type of all functions called in the loops and so you can't include user functions in the loop of JIT optimized loops. Octave doesn't have a JIT and so to some might seem slower than Matlab. For this reason you must vectorize your code as much as possible. The MathWorks themselves have a good document discussing vectorization at http://www.mathworks.com/support/tech-notes/1100/1109.html.
Matlab includes a "Just-In-Time" compiler. This compiler allows the acceleration of for-loops in Matlab to almost native performance with certain restrictions. The JIT must know the return type of all functions called in the loops and so you can't include user functions in the loop of JIT optimized loops. Octave doesn't have a JIT and so to some might seem slower than Matlab. For this reason you must vectorize your code as much as possible. The MathWorks themselves have a good document discussing vectorization at http://www.mathworks.com/support/tech-notes/1100/1109.html.


===Compiler===
== Compiler ==


On a related point, there is no Octave compiler, and so you can't convert your Octave code into a binary for additional speed or distribution. There have been several aborted attempts at creating an Octave compiler. Should the JIT compiler above ever be implemented, an Octave compiler should be more feasible.
On a related point, there is no Octave compiler, and so you can't convert your Octave code into a binary for additional speed or distribution. There have been several aborted attempts at creating an Octave compiler. Should the JIT compiler above ever be implemented, an Octave compiler should be more feasible.


===Graphic handles===
== Graphic handles ==


Up to Octave 2.9.9 there was no support for graphic handles in Octave itself. In the 3.2.N versions of Octave and beyond the support for graphics handles is converging towards full compatibility. The patch function is currently limited to 2-D patches, due to an underlying limitation in gnuplot, but the experimental OpenGL backend is starting to see an implementation of 3-D patches.
Up to Octave 2.9.9 there was no support for graphic handles in Octave itself. In the 3.2.N versions of Octave and beyond, the support for graphics handles is converging towards full compatibility. The patch function is currently limited to 2-D patches, due to an underlying limitation in gnuplot, but the experimental OpenGL backend is starting to see an implementation of 3-D patches.


===GUI functions ===
== GUI functions ==


There are no Matlab compatible GUI functions yet.  This might be an issue if you intend to exchange Octave code with Matlab users. There are a number of bindings from Octave to {{Forge|tcl-octave|Tcl/Tk}}, [http://octaviz.sourceforge.net/index.php? VTK] and {{Forge|zenity}} for example, that can be used for a GUI, but these are not Matlab compatible. Work on a Matlab compatible GUI is in an alpha stage in the QtHandles project, which may form part of a future release of Octave.
There are no Matlab compatible GUI functions yet.  This might be an issue if you intend to exchange Octave code with Matlab users. There are a number of bindings from Octave to {{Forge|tcl-octave|Tcl/Tk}}, [http://octaviz.sourceforge.net/index.php? VTK] and {{Forge|zenity}} for example, that can be used for a GUI, but these are not Matlab compatible. Work on a Matlab compatible GUI is in an alpha stage in the QtHandles project, which may form part of a future release of Octave.


===Simulink===
== Simulink ==


Octave itself includes no Simulink support. Typically the simulink models lag research and are less flexible, so shouldn't really be used in a research environment. However, some Matlab users that try to use Octave complain about this lack.
Octave itself includes no Simulink support. Typically the simulink models lag research and are less flexible, so shouldn't really be used in a research environment. However, some Matlab users that try to use Octave complain about this lack.


===MEX-Files===
== MEX-Files ==


Octave includes an API to the Matlab MEX interface. However, as MEX is an API to the internals of Matlab and the internals of Octave differ from Matlab, there is necessarily a manipulation of the data to convert from a MEX interface to the Octave equivalent. This is notable for all complex matrices, where Matlab stores complex arrays as real and imaginary parts, whereas Octave respects the C99/C++ standards of co-locating the real/imag parts in memory. Also due to the way Matlab allows access to the arrays passed through a pointer, the MEX interface might require copies of arrays (even non complex ones).
Octave includes an API to the Matlab MEX interface. However, as MEX is an API to the internals of Matlab and the internals of Octave differ from Matlab, there is necessarily a manipulation of the data to convert from a MEX interface to the Octave equivalent. This is notable for all complex matrices, where Matlab stores complex arrays as real and imaginary parts, whereas Octave respects the C99/C++ standards of co-locating the real/imag parts in memory. Also due to the way Matlab allows access to the arrays passed through a pointer, the MEX interface might require copies of arrays (even non complex ones).


===Block comments===
== Block comments ==


Block comments denoted by {{Codeline|#{}} and {{Codeline|#&#125;}}  markers (or {{Codeline|%{}} and {{Codeline|%&#125;}}) are supported by Octave with some limitations. The major limitation is that block comments are not supported within [] or {}.
Block comments denoted by {{Codeline|#{}} and {{Codeline|#&#125;}}  markers (or {{Codeline|%{}} and {{Codeline|%&#125;}}) are supported by Octave with some limitations. The major limitation is that block comments are not supported within [] or {}.


===Mat-File format===
== Mat-File format ==


There are some differences in the mat v5 file format accepted by Octave. Matlab recently introduced the "-V7.3" save option which is an HDF5 format which is particularly useful for 64-bit platforms where the standard Matlab format can not correctly save variables. Octave accepts HDF5 files, but is not yet compatible with the "-v7.3" versions produced by Matlab.
There are some differences in the mat v5 file format accepted by Octave. Matlab recently introduced the "-V7.3" save option which is an HDF5 format which is particularly useful for 64-bit platforms where the standard Matlab format can not correctly save variables. Octave accepts HDF5 files, but is not yet compatible with the "-v7.3" versions produced by Matlab.
Line 762: Line 816:
Finally, some multi-byte Unicode characters aren't yet treated in mat-files.
Finally, some multi-byte Unicode characters aren't yet treated in mat-files.


===Profiler===
== Profiler ==


Thanks to Daniel Kraft's 2011 Google Summer of Code project, Octave has a profiler since version 3.6.0. However, at the moment it only produces text output and has its own makeshift interface for hierarchical profiling.
Thanks to Daniel Kraft's 2011 Google Summer of Code project, Octave has a profiler since version 3.6.0. However, at the moment it only produces text output and has its own makeshift interface for hierarchical profiling.


===Toolboxes===
== Toolboxes ==


Octave is a community project and so the toolboxes that exist are donated by those interested in them through [[Octave Forge]]. These might be lacking in certain functionality relative to the Matlab toolboxes, and might not exactly duplicate the Matlab functionality or interface.
Octave is a community project and so the toolboxes that exist are donated by those interested in them through [[Octave Forge]]. These might be lacking in certain functionality relative to the Matlab toolboxes, and might not exactly duplicate the Matlab functionality or interface.


===Short-circuit {{Codeline|&}} and {{Codeline|&#124;}} operators===
== Short-circuit {{Codeline|&}} and {{Codeline|&#124;}} operators ==


The {{Codeline|&}} and {{Codeline|&#124;}} operators in Matlab short-circuit when included in a condition (e.g. an {{Codeline|if}} or {{Codeline|while}} statement) and not otherwise. In Octave only the {{Codeline|&&}} and {{Codeline|&#124;&#124;}} short circuit. Note that this means that
The {{Codeline|&}} and {{Codeline|&#124;}} operators in Matlab short-circuit when included in a condition (e.g. an {{Codeline|if}} or {{Codeline|while}} statement) and not otherwise. In Octave only the {{Codeline|&&}} and {{Codeline|&#124;&#124;}} short circuit. Note that this means that
Line 820: Line 874:
because, despite the name, the {{Codeline|all}} is really returning true if none of the elements of the matrix are zero, and since there are no elements, well, none of them are zero. This is an example of [http://en.wikipedia.org/wiki/Vacuous_truth vacuous truth]. But, somewhere along the line, someone decided that {{Codeline|if ([])}} should be false. Mathworks probably thought it just looks wrong to have {{Codeline|[]}} be true in this context even if you can use logical gymnastics to convince yourself that "all" the elements of an empty matrix are nonzero. Octave however duplicates this behavior for {{Codeline|if}} statements containing empty matrices.
because, despite the name, the {{Codeline|all}} is really returning true if none of the elements of the matrix are zero, and since there are no elements, well, none of them are zero. This is an example of [http://en.wikipedia.org/wiki/Vacuous_truth vacuous truth]. But, somewhere along the line, someone decided that {{Codeline|if ([])}} should be false. Mathworks probably thought it just looks wrong to have {{Codeline|[]}} be true in this context even if you can use logical gymnastics to convince yourself that "all" the elements of an empty matrix are nonzero. Octave however duplicates this behavior for {{Codeline|if}} statements containing empty matrices.


===Solvers for singular, under- and over-determined matrices===
== Solvers for singular, under- and over-determined matrices ==


Matlab's solvers as used by the operators mldivide (\) and mrdivide (/), use a different approach than Octave's in the case of singular, under-, or over-determined matrices. In the case of a singular matrix, Matlab returns the result given by the LU decomposition, even though the underlying solver has flagged the result as erroneous. Octave has made the choice of falling back to a minimum norm solution of matrices that have been flagged as singular which arguably is a better result for these cases.
Matlab's solvers as used by the operators mldivide (\) and mrdivide (/), use a different approach than Octave's in the case of singular, under-, or over-determined matrices. In the case of a singular matrix, Matlab returns the result given by the LU decomposition, even though the underlying solver has flagged the result as erroneous. Octave has made the choice of falling back to a minimum norm solution of matrices that have been flagged as singular which arguably is a better result for these cases.
Line 859: Line 913:
Since the mldivide (\) and mrdivide (/) operators are often part of a more complex expression, where there is no room to react to warnings or flags, it should prefer intelligence (robustness) to speed, and so the Octave developers are firmly of the opinion that Octave's approach for singular, under- and over-determined matrices is a better choice than Matlab's.
Since the mldivide (\) and mrdivide (/) operators are often part of a more complex expression, where there is no room to react to warnings or flags, it should prefer intelligence (robustness) to speed, and so the Octave developers are firmly of the opinion that Octave's approach for singular, under- and over-determined matrices is a better choice than Matlab's.


===Octave extensions===
== Octave extensions ==


The extensions in Octave over MATLAB syntax are very useful, but might cause issues when sharing with Matlab users. A list of the major extensions that should be avoided to be compatible with Matlab are:
The extensions in Octave over MATLAB syntax are very useful, but might cause issues when sharing with Matlab users. A list of the major extensions that should be avoided to be compatible with Matlab are:
Line 933: Line 987:
made it free software so we could reuse large chunks of it which were
made it free software so we could reuse large chunks of it which were
incorporated in what is now the Octave GUI.
incorporated in what is now the Octave GUI.
=Graphics: backends and toolkits=
==What are the supported graphics backends?==
The current default is OpenGL, through the "qt" graphics toolkit.  The "ftlk" toolkit also relies on OpenGL.
Alternatively, Gnuplot can be used as a graphics backend by selecting the "gnuplot" graphics toolkit.
==Why did you replace Gnuplot with an OpenGL backend?==
The development of Octave is committed to being both compatible with Matlab and adding additional features. Toward those ends, the development community has chosen to introduce a native OpenGL backend that supports Matlab handle graphics and its uicontrols. Starting with the 3.8 release, Octave uses OpenGL graphics by default (with FLTK widgets in Octave 3.8 and Qt widgets in Octave 4.0 and later).
==Are there any plans to remove the gnuplot backend?==
There are no plans to remove the gnuplot backend. Even though the default graphics toolkit is now "qt", which uses OpenGL graphics with Qt widgets, the gnuplot backend will still be available as long as our users find it useful.
==How can I implement a new graphics backend/toolkit?==
This is one of those times where the best documentation is to read the existing code. We have three different toolkits in Octave now, so there are some examples to draw from.

Navigation menu