How do I create a callback function which gets executed whenever the XLim value of axes changes?

조회 수: 10 (최근 30일)
I want to create a callback function which will get executed whenever the XLim value is changed from Command Line.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2010년 1월 21일
There is no direct callback that gets executed when XLim/YLim property of the axes changes. But it is possible to create a callback function which will listen to the XLim/YLim property and get executed whenever XLim/YLim changes value.
In order to create a callback function, which gets fired when the XLim value changes, create an event listener using ADDLISTENER for the current axis. Then create a callback function in the same directory and assign it as the PostSet callback of the 'XLim' property.
The attached file, testCallback.m, and the callback function, Callbackfcn, illustrate this.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2008b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by