Bug in plotting - 3.0.4 RC1
Ben Abbott
bpabbott at mac.com
Wed Jan 21 07:02:22 CST 2009
On Jan 21, 2009, at 3:36 AM, Marco Caliari wrote:
>>> Dear maintainers,
>>>
>>> the following script
>>>
>>> x = linspace(0,10,11);
>>> y = x+1;
>>> plot(x,y,x,y)
>>> xlabel('x')
>>> ylabel('y')
>>>
>>> produces the following
>>>
>>> error: __go_draw_axes__: unknown object class, root figure
>>> error: evaluating switch command near line 332, column 7
>>> error: evaluating for command near line 328, column 5
>>> error: evaluating if command near line 25, column 3
>>> error: called from `__go_draw_axes__' in file
>>> `/usr/local/share/octave/3.0.4/m/plot/__go_draw_axes__.m'
>>> error: evaluating switch command near line 58, column 4
>>> error: evaluating for command near line 56, column 2
>>> error: evaluating if command near line 33, column 7
>>> error: evaluating if command near line 26, column 5
>>> error: evaluating if command near line 25, column 3
>>> error: called from `__go_draw_figure__' in file
>>> `/usr/local/share/octave/3.0.4/m/plot/__go_draw_figure__.m'
>>> error: evaluating if command near line 81, column 6
>>> error: evaluating if command near line 78, column 4
>>> error: evaluating if command near line 76, column 2
>>> error: evaluating for command near line 75, column 7
>>> error: evaluating if command near line 45, column 5
>>> error: called from `drawnow' in file
>>> `/usr/local/share/octave/3.0.4/m/plot/drawnow.m'
>>>
>>> I'm using Octave-3.0.4 RC1
>>>
>>> No problem with Octave-3.0.3.
>>>
>>> Best regards,
>>>
>>> Marco
>>
>>
>> I fixed the problem changing back
>>
>> Matrix new_kids (n-1, 1);
>>
>> to
>>
>> Matrix new_kids (1, n-1);
>>
>> as it was in octave-3.0.3/src/graphics.cc
>
> Not sure it is the right fix. In fact, now there is a problem with the
> order of the legends, which can be fixed changing back
>
> for i = nargs:-1:1
>
> to
>
> for i = 1:nargs
>
> as it was in octave-3.0.3/scripts/plot/legend.m
>
> Marco
Marco, please try to reply at the bottom, so that others late to the
discussion can follow along.
Regard this problem, it originated due to children having a reverse
order as compared to the commercial variant. The last change you made
should reverse the order of the legend, which is not correct (1st line
at the bottom and last at the top). Can you confirm?
Regarding your original error, "unknown object class, root figure",
can you/someone confirm exactly where that occurs in __go_draw_axes__?
(I don't have a copy of 3.0.4 available on my Mac).
Browsing the sources, it looks like it is line 941/942 below
314 switch (obj.type)
315 case "image"
[...]
940 otherwise
941 error ("__go_draw_axes__: unknown object class, %s",
942 obj.type);
943 endswitch
I recall the root object had been called "root_figure" in the recent
past and had been changed to "root" in the 3.1+ branch.
Can someone verify that get(0, "type") returns "root_figure" and not
"root" for 3.0.4?
My final comment, I don't see what this has to do with the ordering of
children. Anyone?
Ben
More information about the Bug-octave
mailing list