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: Rik
Subject: [Octave-bug-tracker] [bug #43468] Bug in bar plot data update in Octave 3.8.1
Date: Mon, 27 Oct 2014 16:34:30 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

Update of bug #43468 (project octave):

                  Status:               Need Info => Confirmed              

    _______________________________________________________

Follow-up Comment #5:

Thanks.  Marking this bug as confirmed.  The fix will need to be in the m-file
scripts/plot/draw/private/__bar__.m.  This is the private function which
actually implements bar() or barh().

At the start of the function any vectors present as inputs are made column
vectors.  See the code from line 59 below which applies to the examples used
in this bug report.


y = varargin{1};
if (isvector (y))
  y = y(:);
endif


Unfortunately, this is going to be awkward to solve (i.e, it's going to
require a bunch of special purpose code and if/thens).  The issue is that
normally a second column, as in matrix input, indicates a second bar to plot
rather than just a second point for a single bar color.  If you try


bar (ones (2,4))


you will see that this plots 4 colored bars at two locations.  So it is very
natural to turn a row vector input into a column vector and then pass that to
the routine which plots matrices.

I've made a small change which allows ydata to be set as a row vector,
although internally it still transforms it to a column vector.  I think this
may be a good enough fix rather than trying to code support for row vectors.

I've attached the patch and you can try it out on an existing installation
since it only affects an m-file, not any compiled code.


(file #32325)
    _______________________________________________________

Additional Item Attachment:

File name: bar_ydata.cset                 Size:0 KB


    _______________________________________________________

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]