How to update a Custom Datatip for a GUI figure ?

조회 수: 9 (최근 30일)
Wael Radwan
Wael Radwan 2021년 9월 6일
댓글: Wael Radwan 2021년 9월 12일
I am trying to figure out how to update a custom datatip. The process is straight forward if it was for a regular plot however, when using a GUI figure it seems like that callback function does not update. I tried adding the following lines of code to the existing Callback function but was not successful.
dcm_obj= datacursormode (gcf);
datacursormode on
set (dcm_obj,'updatefcn',@myfunction)
where myfunction is the custom function that I am using to customize the font/color etc...
I would apperciate any suggestions.
Thanks in advance.
  댓글 수: 2
Murugan C
Murugan C 2021년 9월 6일
do you want to show data point dynamically whenever mouse click happend on graph?
Wael Radwan
Wael Radwan 2021년 9월 12일
No static would be enough. I would like to custom the blue color on the text given in the image attached to black.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2021년 9월 12일
The update function callback is only applied to new datatips, or datatips that are moved. (I am not certain at the moment whether it is called if the axes resizes.)
  댓글 수: 1
Wael Radwan
Wael Radwan 2021년 9월 12일
Ah I see. Everything works now when I deleted the old datatips and added new ones. I was under the assumption it auto updates which is not the case. Well thanks alot for your help !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by