bugGNU Octave - Bugs: bug #39483, axes "handlevisibility"...

 
 

bug #39483: axes "handlevisibility" not properly handled with new children objects

Submitted by:  Pantxo Diribarne <pantxo>
Submitted on:  Sun 14 Jul 2013 04:21:58 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.6.3Operating 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)

Sun 21 Jul 2013 03:03:04 PM UTC, comment #12:

Indeed, it works fine after an update to 17028.

Pantxo Diribarne <pantxo>
Project Member
Sun 21 Jul 2013 02:51:05 PM UTC, comment #11:

Is the regression still present after 17025:75d115e329b7? (http://hg.savannah.gnu.org/hgweb/octave/rev/75d115e329b7) I had noticed the same issue and checked in a change for it. Your sample code works for me with 17025.

Rik <rik5>
Project Administrator
Sun 21 Jul 2013 02:31:25 PM UTC, comment #10:

I see a regression due to our patches. The following code doesn't work anymore:

This should return true. Attached is a patch : if the parent handle points to an hggroup, the prop/val pair should not be deleted.

(file #28635)

Pantxo Diribarne <pantxo>
Project Member
Fri 19 Jul 2013 05:50:35 PM UTC, comment #9:

Some (many?) high level functions also use gca() to store the current axes and reset it if a problem occured. I posted the new bug report at
https://savannah.gnu.org/bugs/?39529

Pantxo Diribarne <pantxo>
Project Member
Fri 19 Jul 2013 03:34:20 PM UTC, comment #8:

Why don't you open a new bug report, just to be clear. I'll probably still be the one who responds and commits your patches.

It seems like the "core" graphics objects which are low-level functions need to be checked. Previously, they always used a call to gca() to plot into the current, or newly created, axis. This can now be removed in favor of a call to _plt_get_axis_arg_ to check whether they are being re-parented.

The line.m function now reads:

The core graphics objects which possibly need updating are:
axes
image
patch
rectangle
surface
text

Other functions, like surf, build upon these and probably do the right thing alread.

Rik <rik5>
Project Administrator
Fri 19 Jul 2013 09:56:08 AM UTC, comment #7:

Thanks. I can review the graphics functions that behave as line used to and propose patches (for text.m at least ) if you think it's worth the effort. If so, should I post the patches here or open a new dedicated bug report?

Pantxo Diribarne <pantxo>
Project Member
Fri 19 Jul 2013 06:00:48 AM UTC, comment #6:

I applied your two patches to the development branch of Octave. I also followed it up with another changeset where I was able to simplify some of the tests. strcmpi(), for example, does case insensitive matching (no need for tolower) and doesn't require that you check for character inputs first. It knows that those are not strings and will return false for them.

Thanks for writing patches. It makes thing a lot easier for the few maintainers who spend time watching the bug reports.

Rik <rik5>
Project Administrator
Thu 18 Jul 2013 11:02:01 PM UTC, comment #5:

The patch for plt_get_axis_arg.m is buggy. Attached is cleaner ... I hope.

(file #28613)

Pantxo Diribarne <pantxo>
Project Member
Wed 17 Jul 2013 09:39:33 PM UTC, comment #4:

Yes I did test the first example in ML and it returns empty matrix. The problem has finally nothing to fo with "handlevisibility", but with the presence of a current axes. The following example also returns empty matrix for the current axes in ML:

returns "current figure: 2, current axes " (thus empty matrix), and "ax" has been populated with a new line with no axes creation in figure (2).

In octave a new axes is created in figure (2) before populating "ax" with the line, result : "current figure: 2, current axes -32.447683". An example patch for line.m is attached (which depends on the previous one).

(file #28607)

Pantxo Diribarne <pantxo>
Project Member
Wed 17 Jul 2013 03:07:50 PM UTC, comment #3:

Do you have access to test this in Matlab? I'm not sure that they will do anything different. The documentation on handlevisibility doesn't make it clear what is supposed to happen in this case.

If your original example runs without creating an additional axis in the figure then we should look at changing how line() operates.

Rik <rik5>
Project Administrator
Mon 15 Jul 2013 10:13:18 PM UTC, comment #2:

In the example below "ax" handle is not visible and not the current axes as expected :

Then, when "gca ()" is called in line.m (also text.m, image.m ...) a new axes is created.

Most plot functions (not line, but it probably could) use _plt_get_axis_arg_.m to parse input arguments and retrieve parent axes. The attached patch adds a search for "parent" property in _plt_get_axis_arg_.m. If present the prop/val pair is removed and the righ parent axes is returned. It works for hggroup where no call to "gca ()" is done:

returns the empty matrix as expected. I think using this patch and replacing the calls to "gca ()" by "get (fig, "currentaxes")" in the various line, text... functions should work. Should I go ahead ?

(file #28589)

Pantxo Diribarne <pantxo>
Project Member
Sun 14 Jul 2013 04:24:58 PM UTC, comment #1:

Sorry, a typo in verbatim ... the end of the report :

I tested with other types of objects (hggroup, image, text) and the result is
the same. Tested in dev and 3.6.3 octave versions

Pantxo Diribarne <pantxo>
Project Member
Sun 14 Jul 2013 04:21:58 PM UTC, original submission:

When a new children is added to an axes which has its "handlevisibility" property set to "off", a new unused axes is created on top. The following code demonstrates this behavior :

Pantxo Diribarne <pantxo>
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 #28635:  preserve_hggroup.diff added by pantxo (896B - text/x-patch)
file #28613:  get_parentaxes.diff added by pantxo (2KiB - text/x-patch)
file #28607:  line_avoid_gca.patch added by pantxo (797B - text/x-patch)
file #28589:  parse_plt_propval.patch added by pantxo (1KiB - text/x-patch)

 

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 pantxo (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Jul 2013 02:31:25 PM UTCpantxoAttached File-=>Added preserve_hggroup.diff, #28635
    Fri 19 Jul 2013 06:00:48 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 18 Jul 2013 11:02:01 PM UTCpantxoAttached File-=>Added get_parentaxes.diff, #28613
    Wed 17 Jul 2013 09:39:33 PM UTCpantxoAttached File-=>Added line_avoid_gca.patch, #28607
    Mon 15 Jul 2013 10:13:18 PM UTCpantxoAttached File-=>Added parse_plt_propval.patch, #28589

    Back to the top


    Powered by Savane 3.1-cleanup1