bugGNU Octave - Bugs: bug #47237, scatter plot update_data callback...

 
 

bug #47237: scatter plot update_data callback only works when number of points <= 100

Submitted by:  None
Submitted on:  Tue 23 Feb 2016 05:21:07 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: FranciscoOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 03 Jul 2016 11:20:11 AM UTC, comment #5:

Rik, I saw that only one loop would run. It was just maintainability I was asking about.

Here are two patches. The first goes from eight loops to four by merging cases with different edge colours. The second goes from four to two by merging the 2D and 3D cases. I personally find spot-the-difference code really hard to maintain, but you know better than me if the z{i}=[] trick is worse.

I'm happy for these to wait until after 4.2.0, since you're busy.

(file #37682, file #37683)

Lachlan Andrew <lachlan>
Project Member
Sat 02 Jul 2016 06:00:47 PM UTC, comment #4:

@Lachlan: The reason for the 100 points is performance. The base code creates two very different implementations based on the number of points. The callback is not set up to shift from one implementation to the other, so the best thing was simply to warn that it couldn't accomplish that shift.

As for the duplicate loops, they won't be a performance issue since only one of them will ever be chosen. But you are right that it is a lot of code to maintain. If you want to submit a patch that reduces the number of loops from 8 to 4 I can review and push.

Rik <rik5>
Project Administrator
Fri 24 Jun 2016 04:57:42 AM UTC, comment #3:

Rik, what is the reason for the limit of 100? Looking at the patch in isolation, it seems to be entirely self-imposed.

Does it call something that fails with more than 100 points?

Is it a performance consideration?

Also, is there a reason for duplicating the loops for "markerfacecolor" equal to c vs "none"? Couldn't we set

and similarly with "flat" vs "none", to give four loops instead of eight?

(Now it's my turn to argue for simple=maintainable code :)

Lachlan Andrew <lachlan>
Project Member
Wed 24 Feb 2016 07:15:04 PM UTC, comment #2:

The problem is the update_data callback routine in _scatter_.m. I don't think this was ever updated after the main part of the algorithm was changed. I fixed this here (http://hg.savannah.gnu.org/hgweb/octave/rev/fb7f40558553) and your example now runs properly.

However, the fix only captures the case where the number of points is <= 100. I've re-titled the bug to reflect the still open issue.

The fix will be a part of the 4.2 release. Because this is just an m-file you can also download it from the Mercurial repository and install it on your function path if you want the fix earlier.

Rik <rik5>
Project Administrator
Tue 23 Feb 2016 05:38:38 PM UTC, comment #1:

Confirmed. The bug is also present on the development branch.

Rik <rik5>
Project Administrator
Tue 23 Feb 2016 05:21:07 PM UTC, original submission:

try the following code to change the data in a scatter plot
figure
h = scatter3([1 2], [3 4], [5 6],'k')
set(h,'XData',[3 4])

The set command fails with the following comment:
error: invalid use of colon in function argument list
error: called from
_scatter_>update_data at line 381 column 7
error: evaluating argument list element number 1
error: called from
_scatter_>update_data at line 381 column 7
error: evaluating argument list element number 5
error: called from
_scatter_>update_data at line 381 column 7

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 03 Jul 2016 11:20:11 AM UTClachlanAttached File-=>Added bug_47237_scatter_4_loops.cset, #37682
      Attached File-=>Added bug_47237_scatter_2_loops.cset, #37683
    Wed 24 Feb 2016 07:15:04 PM UTCrik5Release4.0.0=>dev
      SummaryI cannot set the Data properties (X, Y or Z) of a scatter or scatter3 plot=>scatter plot update_data callback only works when number of points <= 100
    Tue 23 Feb 2016 05:38:38 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1