Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Error message with impixelinfoval: iptaddcallback cannot set callbacks on figure with an active mode.

Subject: Error message with impixelinfoval: iptaddcallback cannot set callbacks on figure with an active mode.

From: Camille Couzi

Date: 13 Aug, 2010 16:00:22

Message: 1 of 1

Hi,
I am working on a GUI which has many panels, buttons,... and there is a panel with 5subplots, where I display imagesc from matrix values (with colormaps).
I wanted to know what is the position of the mouse when positionning it on one of the subplots, and I just discovered impixelinfoval and impixelinfo.

The function for plotting the imagesc is in a callback (when pressing a button where I choose which matrix I want to display on a subplot).
This is part of the function callback I have (sorry it is in spanish for some names):

--------------------------
function ploteo_prefiltrado(eje,matriz,ac,bl,titulo_figura,h)

set(gcf,'CurrentAxes',eje)
colormap(jet(60));
% imagesc(matriz)
Im=imagesc(matriz);
colorbar
% hText = impixelinfoval(gcf,Im)
hPixlInfoVal = impixelinfoval(h.panel_contourplots,Im);
-----------------------------------
h.panel_contourplots is the panel where are included the subplots.
That send me an error message:


??? Error using ==> iptaddcallback at 69
iptaddcallback cannot set callbacks on figure with an active mode.

Error in ==> impixelinfoval at 81
callbackID = iptaddcallback(hFig,'WindowButtonMotionFcn', @displayPixelInfo);

Error in ==> ploteo_prefiltrado at 17
hPixlInfoVal = impixelinfoval(h.panel_contourplots,Im);

Error in ==> filtrado_Pelicanos_sinGuide2>Ploteo_plot1 at 595
    ploteo_prefiltrado(eje1,matriz,h.ac,h.bl,titulo,h);

Error in ==> hgfeval at 63
        feval(fcn{1},varargin{:},fcn{2:end});

Error in ==> uitools.uibuttongroup.childAddedCbk>manageButtons at 80
    hgfeval(cbk, source, evdata);

??? Error while evaluating uicontrol Callback


I think that means that i can't use impixelinfo or impixelinfo in a callback, it as to be direct...

Any idea of how I can solve that?
Thanks a lot

Camille.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us