bugGNU Octave - Bugs: bug #35216, line(x,y,'propname','propvalue')...

 
 

bug #35216: line(x,y,'propname','propvalue') throw error

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Mon 02 Jan 2012 01:00:07 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Fri 06 Apr 2012 11:23:13 PM UTC, comment #10:

I added a demo and pushed the changeset.

http://hg.savannah.gnu.org/hgweb/octave/rev/8150ccfffa22

Ben Abbott <bpabbott>
Project Member
Fri 06 Apr 2012 04:24:45 PM UTC, comment #9:

Thanks. I now have two examples where one works and the other fails. I'm attaching a patch that is based on your work so you should get the credit for it. Can you verify that it also works for you and commit it?

The examples I used were

(file #25602)

Rik <rik5>
Project Administrator
Fri 06 Apr 2012 04:06:48 PM UTC, comment #8:

Which example ?

The one below ?

This should just produce two points. Perhaps a better example is

Ben Abbott <bpabbott>
Project Member
Fri 06 Apr 2012 03:58:19 PM UTC, comment #7:

Okay. I gather now that the vectors are column vectors rather than row vectors. But according to comment #3, there was no problem when plot was used instead of line. However, I don't even get a line when I try the example

Rik <rik5>
Project Administrator
Fri 06 Apr 2012 03:37:40 PM UTC, comment #6:

Rik,

I tried the version below on both 3.4.0 and the default branch. Both gave me the same result.

The result is the same as

The reason you saw three points is because your version was equivalent to

Ben Abbott <bpabbott>
Project Member
Fri 06 Apr 2012 03:17:20 PM UTC, comment #5:

Ben, we've sort of ignored this bug report for a while.

I think something else may have crept into the code. Starting with a current tip and no patches applied if I try

I don't get two lines, just 3 points. This was supposed to work according to comment #3.

Rik <rik5>
Project Administrator
Tue 21 Feb 2012 12:42:30 AM UTC, comment #4:

I see. Well it still looks reasonable to use your approach but I would shift to using bsxfun rather than broadcasting. This will avoid having to set and restore the broadcasting warning state.

The following works:

The try/catch architecture is still needed.

Rik <rik5>
Project Administrator
Tue 21 Feb 2012 12:10:27 AM UTC, comment #3:

It is more than just comparing sizes. For compatibility the sizes (up to 2d) need a broadcast sort of functionality. In addition, the prop-name & prop-value pairs need to be supported.

Both the examples below work for Matlab. In Octave, both work if "line" is replaced by "plot".

Ben Abbott <bpabbott>
Project Member
Mon 20 Feb 2012 09:09:29 PM UTC, comment #2:

Ben,

If I understand your changeset you are just looking to see whether the number of elements for the X, Y, and Z arguments are the same. I think you can do this succinctly without broadcasting by using the isequal function which is equivalent to 'a == b == c == ...' and only returns true if everything is equal.

Looking at changeset-1.patch, I think the whole thing could be simplified to

Rik <rik5>
Project Administrator
Mon 02 Jan 2012 11:29:36 PM UTC, comment #1:

I'm not sure what the correct solution here is.

Recently Jordi added broadcasting to Octave. This feature is well suited toward plot functions.

Should each plot function handle the broadcasting independently, of should a single function be written for that purpose?

I've attaching two changesets. changeset-1.patch handles everything. The second version, changeset-2.patch, relies on a second function, broadcast(). I'm also attaching a prototype broadcast.m. However, I think it should be written in c++, so it isn't included as part of the changeset.

(file #24725, file #24726, file #24727)

Ben Abbott <bpabbott>
Project Member
Mon 02 Jan 2012 01:00:07 PM UTC, original submission:

The docs indicate that line(x,y,z,name,value) is valid syntax. Without "z" an error results.

In addition,

Both of these work in ML R2011b.

Ben Abbott <bpabbott>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #25602:  bug35216.patch added by rik5 (756B - application/x-download)
file #24725:  changeset-1.patch added by bpabbott (1KiB - application/octet-stream)
file #24726:  broadcast.m added by bpabbott (1KiB - application/octet-stream)
file #24727:  changeset-2.patch added by bpabbott (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by bpabbott (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 06 Apr 2012 11:23:13 PM UTCbpabbottStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Fri 06 Apr 2012 04:24:45 PM UTCrik5Attached File-=>Added bug35216.patch, #25602
    Mon 02 Jan 2012 11:29:36 PM UTCbpabbottAttached File-=>Added changeset-1.patch, #24725
      Attached File-=>Added broadcast.m, #24726
      Attached File-=>Added changeset-2.patch, #24727
      StatusNone=>Patch Submitted

    Back to the top


    Powered by Savane 3.1-cleanup1