'figure' does not accept 0 as argument

John W. Eaton jwe at bevo.che.wisc.edu
Sun Mar 9 21:07:50 CDT 2008


On  9-Mar-2008, Sergei Steshenko wrote:

| Hello All,
| 
| I've noticed this behavior:
| "
| GNU Octave, version 3.0.0
| Copyright (C) 2007 John W. Eaton and others.
| This is free software; see the source code for copying conditions.
| There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
| FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
| 
| Octave was configured for "i686-pc-linux-gnu".
| 
| Additional information about Octave is available at http://www.octave.org.
| 
| Please contribute if you find this software useful.
| For more information, visit http://www.octave.org/help-wanted.html
| 
| Report bugs to <bug at octave.org> (but first, please read
| http://www.octave.org/bugs.html to learn how to write a helpful report).
| 
| For information about changes from previous versions, type `news'.
| 
| octave:1> figure(0)
| warning: get: invalid property `type'
| error: figure: expecting figure handle or figure number
| error: evaluating if command near line 41, column 5
| error: evaluating if command near line 39, column 3
| error: called from `figure' in file
| `/maxtor5/sergei/AppsFromScratchWD/install/octave-3.0.0/share/octave/3.0.0/m/plot/figure.m'
| octave:1> figure(1)
| octave:2>
| ".
| 
| Well, still, 0 is an integer number, so I do not understand the "figure number" part in
| "error: figure: expecting figure handle or figure number" message.

The diagnostic could be better, but it is not a bug that figure (0)
fails since the graphics handle 0 is the identifier for the special
"root figure", which is somewhat like the base object for all
graphics objects.  You can use it to set defaults for other graphics
objects, but you can't display it like other figures.

jwe


More information about the Bug-octave mailing list