bugGNU Octave - Bugs: bug #45473, imshow "Parent" property

 
 

bug #45473: imshow "Parent" property

Submitter:  Amro <amro_octave>
Submitted:  Sat 04 Jul 2015 01:46:40 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 06 Jul 2015 04:34:37 AM UTC, comment #4: 

Yes, quite right.  I changed imshow.m to apply axes properties to the parent of the image object, whether that is gca() or not.  I also added stricter input validation to make sure that any supplied "parent" property is indeed an axes.  See this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/928e2c6f888e).

Rik <rik5>
Group administrator
Mon 06 Jul 2015 03:10:12 AM UTC, comment #3: 

btw, shouldn't all mentions of "gca()" in that file be replaced with the explicit axes handle in case it was specified?

Amro <amro_octave>
Mon 06 Jul 2015 03:00:44 AM UTC, comment #2: 

Awesome, thanks.

Amro <amro_octave>
Sun 05 Jul 2015 08:57:05 PM UTC, comment #1: 

This was easy.  I fixed it on the development branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/eca5aa3225f4).

Rik <rik5>
Group administrator
Sat 04 Jul 2015 01:46:40 PM UTC, original submission:  

Both "image" and "imagesc" functions implement the "Parent" property. However it is currently missing from the "imshow" function. It shows a warning and ignores the argument...

Note that IMSHOW uses IMAGE/IMAGESC underneath, so I expect it wouldn't be difficult to add support for it.

This property is especially useful when showing images in different subplots inside a loop. Here is an example:


h(1) = subplot(121);
h(2) = subplot(122);
for i=1:2
    imshow(rand(10), 'Parent',h(i))
end


The workaround is to manually set the current axis before calling IMSHOW:


for i=1:2
    axes(h(i))
    imshow(rand(10))
end


Amro <amro_octave>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 amro_octave (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-07-05 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code