bugGNU Octave - Bugs: bug #41458, plot(x,[y1,y2,y3]) does not work

 
 

bug #41458: plot(x,[y1,y2,y3]) does not work

Submitted by:  Hartmut <hardy>
Submitted on:  Tue 04 Feb 2014 06:33:33 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 05 Feb 2014 07:24:41 PM UTC, comment #3:

Sorry for the confusion. You are totally right. The command in my bug report should be

plot(x,[a;b;c]);

Then it plots perfectly well in Octave 3.8.0 as well as in Matlab.

Please just close this issue.

Hartmut <hardy>
Wed 05 Feb 2014 01:25:50 PM UTC, comment #2:

Hi,

I can support Mikes comment. plot(x,[a;b;c]); works in both Octave 3.8 and MATLAB.

[code]

>> ver

-------------------------------------------------------------------------------------------------------
MATLAB Version: 8.0.0.783 (R2012b)
MATLAB License Number: ---
Operating System: Linux 3.7.10-1.24-desktop #1 SMP PREEMPT Wed Oct 2 11:15:18 UTC 2013 (375b8b4) x86_64
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------------------------

>> x=[0:0.01:2*pi];

a = sin(x);
b = cos(x);
c = a.*b;

plot(x,[a,b,c]);
Error using plot
Vectors must be the same lengths.
[/code]

Kai Torben Ohlhus <siko1056>
Project Member
Tue 04 Feb 2014 07:51:49 PM UTC, comment #1:

Hi, thanks for your bug report. Can you please double-check your example in Matlab and make sure you have your vector orientations correct?

Note that in your example, all of the vectors are row vectors, and in the plot command you provided you are concatenating the row vectors a, b, and c into one large row vector that is 3 times as long as x. I would be surprised if Matlab allowed that.

If you used [a;b;c] instead, you'd have a 3-by-600-something matrix and that plot command would work in Octave. Alternatively, if x were a column vector, the rest of your example would work perfectly in Octave as well.

Mike Miller <mtmiller>
Project Administrator
Tue 04 Feb 2014 06:33:33 PM UTC, original submission:

In Matlab there is the possibility to plot several vectors (of equal length) against one common x vector. This does currently (version 3.8.0) NOT work in Octave.

Here is an example:

In Octave this throughs an error:
error: _plt2vv_: vector lengths must match

In Matlab it generates a plot that is identical to

Hartmut <hardy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by siko1056 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by hardy (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 05 Feb 2014 07:46:39 PM UTCmtmillerStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Tue 04 Feb 2014 07:51:49 PM UTCmtmillerStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1