octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43468] Bug in bar plot data update in Octave


From: anonymous
Subject: [Octave-bug-tracker] [bug #43468] Bug in bar plot data update in Octave 3.8.1
Date: Fri, 24 Oct 2014 10:26:56 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

URL:
  <http://savannah.gnu.org/bugs/?43468>

                 Summary: Bug in bar plot data update in Octave 3.8.1
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 24 Oct 2014 10:26:55 UTC
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: Ian Flintoft
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:


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





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43468>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]