bugGNU Octave - Bugs: bug #51723, orderfields does not correctly...

 
 

bug #51723: orderfields does not correctly work with a second argument specifying ordering

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Thu 10 Aug 2017 05:30:43 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 11 Aug 2017 04:44:59 AM UTC, comment #12: 

Looks good with fltk/qt (do we need all those drawnow() calls in
demo copyobj code?)
Demo still looks slightly off for gnuplot backend, but ptobably it is a different bug.

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Fri 11 Aug 2017 04:17:58 AM UTC, comment #11: 

Ugh.  orderfields was completely busted and the BIST tests were too simple to detect it.  I changed it to use true permutation matrices and it now seems fine.  See cset http://hg.savannah.gnu.org/hgweb/octave/rev/92a3b165689e.


Rik <rik5>
Group administrator
Fri 11 Aug 2017 02:44:01 AM UTC, comment #10: 

I did some more testing and used this version of copyobj demo


%!demo
%! hobj = clf;
%! set (hobj, "name", "Original", "numbertitle", "off");
%! hold on;
%! x = 1:10;
%! y = x.^2;
%! dy = 2 * (.2 * x);
%! y2 = (x - 3).^2;
%! hg = errorbar (x, y, dy);
%! set (hg, "marker", "^", "markerfacecolor", rand (1,3));
%! plot (x, y2, "ok-");
%! legend ("11errorbar", "line");
%! title( "Original");
%! drawnow ();
%! pos = get (hobj, "position");
%! scrn = get (0, "screensize");
%! set (hobj, "position", [scrn(3)/2-pos(3)-10, scrn(4)/2-pos(4)/2, pos(3:4)]);
%! drawnow ();
%! % get(hobj)
%! hnew = copyobjds (hobj);
%! % get(hnew)
%! drawnow ();
%! set (hnew, "name", "Copyobj");
%! legend ("errorbar22", "line");
%! title( "new");
%! drawnow ();
%! set (hnew, "position", [scrn(3)/2-pos(3)-10, scrn(4)/2-pos(4)/2, pos(3:4)]);
%! drawnow ();


1) orderfiels.m is called 14 times!!
2) with a breakpoint in copyobj it stops after the first window is created.
3) The fist window looks good at this point.
4) the legend has 11errorbar and title is "original"
5) and box is good
6) continue from break-point
7)with a break-point in orderfields.m you can watch it construct the next window.
8) and at the end the title "original shows up on the 2nd window and the box gets small.
9) the first window now has a title of "new" and a legend of "errorbar22" and a good size box.
10)  It is the newer window that in now titled "original" that has the small box.



Doug Stewart <dastew>
Fri 11 Aug 2017 01:26:52 AM UTC, comment #9: 

I have been thinking about this and my impression is that orderfields must be used deeper than what is visible in the demo copyobj. Is there an easy way to see if it is called more than once? maybe a breakpoint in orderfields?

Doug Stewart <dastew>
Fri 11 Aug 2017 12:45:56 AM UTC, comment #8: 
Doug Stewart <dastew>
Fri 11 Aug 2017 12:26:38 AM UTC, comment #7: 

What is your last good/bad bracket?

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Thu 10 Aug 2017 11:57:09 PM UTC, comment #6: 

@Rik
I did some checking and the window with the bad legend box is the original, not the copy.
So this is even more confusing
( I made a different legend in the copy and then I realised that the original was small)

But why it would show up at this change set is ?????

Doug Stewart <dastew>
Thu 10 Aug 2017 09:37:47 PM UTC, comment #5: 

@Doug: You're definitely right that it is a change in orderfields, but I can't figure out what is going on.  I made a copy of the old function and called it orderfields2.  I then call both orderfields and orderfields2 and compare their outputs using isequaln during copyobj and everything is identical.


Rik <rik5>
Group administrator
Thu 10 Aug 2017 07:41:59 PM UTC, comment #4: 

this is the first bad one.


Changeset:
23349 (4f07b4770eec) orderfields.m: recode algorithm to halve running time (bug #50688). …

Doug Stewart <dastew>
Thu 10 Aug 2017 07:03:19 PM UTC, comment #3: 

One way to restore updating is to get the handle for the "legend" axes object and then change the property "cameraupvectormode" from "manual" to "auto".  After that, slightly changing the plot size will force a redraw and the box will be calculated correctly.

The issue is why the axes size is not correctly.  The "position" and "outerposition" properties match.  There is something strange with the "tightinset" property which has negative numbers in it.  But I can get those to go away after resizing the plot so that they are updated.

Rik <rik5>
Group administrator
Thu 10 Aug 2017 06:26:54 PM UTC, comment #2: 

Confirmed.  This may have something to do with the fact that legend objects are not fully copied.  It also could be a consequence of the change to listeners that is affecting colorbars.

Rik <rik5>
Group administrator
Thu 10 Aug 2017 06:16:23 PM UTC, comment #1: 

I will bisect

Doug Stewart <dastew>
Thu 10 Aug 2017 05:30:43 PM UTC, original submission:  

The textbox around plot keys is wrong in "demo copyobj 1"
(hg id d56c18dc1373+ tip @)
See attached.
Worked fine in 4.2.1.

Dmitri.

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-11 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
        Summarylegend box incorrectly sized in &quot;demo copyobj 1&quot; orderfields does not correctly work with a second argument specifying ordering
    2017-08-10 rik5 Summarytext box wrong in &quot;demo copyobj 1&quot; legend box incorrectly sized in "demo copyobj 1"
    2017-08-10 rik5 StatusNone Confirmed
    2017-08-10 dasergatskov Attached File- Added copyobj_original.png, #41473
        Attached File- Added copyobj_copyobj.png, #41474

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code