How to Re-position DataCursormode 'Window'

4 次查看(过去 30 天)
So Matlab figures have a datacursormode that either show up as a datatip or a window. I would like to make use of the window but unfortunately every time I turn it on it appears on the bottom right of the figure. Currently I am using a custom UpdateFcn for the datacursormode, and cannot figure out a way to program the window to pop up in a specific position on my figure -- I am wondering if this is possible.
Thanks!

采纳的回答

Karun Mathiazhagan
Karun Mathiazhagan 2019-5-26
Hello Kevin,
You could use the "findall" function with the name-value pair 'Tag', 'DataCursorMode:FigurePanel' to obtain the handle to the Data Cursor window. Following this, you could use the property "Position" of the obtained handle to set the desired position.
I hope this helps.
Best,
Karun
  1 个评论
Kevin Phung
Kevin Phung 2019-5-29
Karun, this is perfect! Thank you! I have an additional question regarding this is:
So I am able to set the position of the data cursor once the user selects a data point, as it triggers the UpdateFcn. However, is there a way to set the position upon clicking the 'datacursormode' icon? Because when it is first clicked, it is set to its default position on the bottom right.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by