From: Camille Couzi on
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.
 | 
Pages: 1
Prev: algebraic loop
Next: Make recursion faster...