Fri 24 Oct 2014 10:26:55 AM UTC, original submission:
Hi,
I am using Octave 3.8.1, Ubuntu 14.04.1 LTS, fully patched, 64-bit, distribution package.
Should the shape of 1D data (i.e row or column vector) passed to bar make a difference to updates using set?
This works OK:
octave:1> genotype=rand(4,1)
genotype =
0.71002
0.35112
0.11692
0.86428
octave:2> hl = bar(genotype)
hl = -17.264
octave:3> genotype=rand(4,1)
genotype =
0.45987
0.25877
0.63505
0.96748
octave:4> set (hl, 'YData', genotype);
This fails:
octave:5> genotype=rand(1,4)
genotype =
0.47919 0.40458 0.93713 0.17101
octave:6> hl = bar(genotype)
hl = -15.355
octave:7> genotype=rand(1,4)
genotype =
0.868794 0.187961 0.571303 0.023557
octave:8> set (hl, 'YData', genotype);
error: update_data: A(I): index out of bounds; value 2 out of bound 1
error: called from:
error: /usr/share/octave/3.8.1/m/plot/draw/private/__bar__.m at line 445, column 12
In both cases the shape of the data is the same for the initial call to bar and the update. I'm using this down at a low level in a genetic algorithm code which used to work fine but doesn't like Octave 3.8.1. Not sure at what point this changed because
I haven't used the code for some time - certainly it was OK in 3.6.x series Octave when I developed the code.
The line which fails is * below
for i = 1:columns (y)
- hp = get (hlist(i), "children");
if (vertical)
set (hp, "xdata", xb(:,:,i), "ydata", yb(:,:,i));
else
set (hp, "xdata", yb(:,:,i), "ydata", xb(:,:,i));
endif
endfor
So presumably i is going beyond the end of hlist.
FYI, the "other code implementation" works in both cases.
It tried copying _bar_.m from 3.8.2 into my 3.8.1 distribution
but I still get the same error.
Best Regards,
Ian
|