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

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

[Octave-bug-tracker] [bug #47149] line ([x1, x2]', [y1, y2]) works in Ma


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #47149] line ([x1, x2]', [y1, y2]) works in Matlab but not Octave
Date: Thu, 18 Feb 2016 05:34:32 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0 Iceweasel/44.0

Follow-up Comment #5, bug #47149 (project octave):

I see this behavior:


octave:1> h = line ([1,2]',[3,4])
h =

  -23.803
  -24.839

octave:2> get (h(1), {'xdata', 'ydata'})
ans = 
{
  [1,1] =

     1   2

  [1,2] =

     3   3

}
octave:3> get (h(2), {'xdata', 'ydata'})
ans = 
{
  [1,1] =

     1   2

  [1,2] =

     4   4

}


Then if I change the axis limits, the horizontal lines appear in the plot
window.

So it looks like the problem is that line is doing something similar to
broadcasting and creating two line objects instead of recognizing that there
are two vectors of the same length.

When fixing this, it's important to make sure that the x and y data stored in
the line object are oriented in a Matlab-compatible way.  Do they retain their
original orientation, or is one transposed so they are both row (or column)
vectors?

I see that the following appears to work, so I think the bug is just in making
line recognize the case of vectors with different orientations.


h = line;
set (h, 'xdata', [1,2]', 'ydata', [3,4])



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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