Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Problem with new figure under "KeyReleaseFcn"
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Valeriy

Posts: 59
Registered: 3/17/08
Problem with new figure under "KeyReleaseFcn"
Posted: Oct 26, 2012 5:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all
I need to process some data that are presented in figure, using
KeyReleaseFcn function and than draw result in new figure.
Structure of code is following:

h = figure('KeyReleaseFcn',@whatPressed);
...
function whatPressed(src,evnt)
...
ShowPlane(iZ,iG);

if strcmp(evnt.Modifier,'control') && strcmp(evnt.Key,'uparrow')
DoSomeCalculations
xzFig = figure;
pcolor(X,Z,XZ);
...
end % of if

function ShowPlane(iZ,iG)
...
wrkFgr = imagesc(Y,X, yxCross);
...
end % of ShowPlane

end % of whatPressed

Problem is localized in line "xzFig = figure;"
When I run this function a few first times it works correctly,
but than new figure (xzFig) copy content of original figure (wrkFig) that is drawn
by ShowPlane function. Under debugger I see that this happens in line
"xzFig = figure;": new figure window is not empty but repeat content of
wrkFig figure from ShowPlane.

Exchange this line by "figure;" do not change function's behavior.

Exchange it by "xzFig = newplot" with or without parameters gives again
copy of original figure (wrkFig) immediately.

What is wrong, how I can have correct function reaction?

Thanks in advance for your ideas




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.