bugGNU Octave - Bugs: bug #52799, listener on axes...

 
 

bug #52799: listener on axes "colormap" property does not work

Submitter:  Rik <rik5>
Submitted:  Wed 03 Jan 2018 07:32:52 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 04 Jan 2018 01:49:04 AM UTC, comment #2: 

@Pantxo: Thanks for the really quick fix.  I pushed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/2f10c3265607).  That allowed me to fix one of the remaining issues with colorbar.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 03 Jan 2018 11:47:52 PM UTC, comment #1: 

The attached simple cset fixes the issue for me.

(file #42816)

Pantxo Diribarne <pantxo>
Group Member
Wed 03 Jan 2018 07:32:52 PM UTC, original submission:  

While re-writing colorbar.m I came across the fact that listeners on the axes property "colormap" are not executed.  This is probably because "colormap" for axes is a complicated property implemented by a function rather than just a regular property.

Sample code, which is also attached, is


close all;

function cb_fig_colormap (hf, ~)
  fprintf (stderr, "Figure callback executed\n");
  fflush (stderr);
endfunction

function cb_axes_colormap (hf, ~)
  fprintf (stderr, "Axes callback executed\n");
  fflush (stderr);
endfunction

hf = figure ();
hax = gca ();
addlistener (hf, "colormap", @cb_fig_colormap);
addlistener (hax, "colormap", @cb_axes_colormap);

fprintf (stderr, "changing Axes colormap\n");
set (hax, "colormap", jet (8));
assert (get (hax, "colormap"), jet(8));
fprintf (stderr, "changing Figure colormap\n");
set (hf, "colormap", jet (16));
assert (get (hf, "colormap"), jet(16));



Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #42816:  colormap_listen.patch added by pantxo (1KiB - text/x-patch)
file #42811:  tst_cb_colormap.m added by rik5 (609B - text/x-matlab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by rik5 (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-04 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-01-03 pantxo Attached File- Added colormap_listen.patch, #42816
        StatusNone Patch Submitted
    2018-01-03 rik5 Attached File- Added tst_cb_colormap.m, #42811

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code