How do I change the data cursor size, colour and shape?

29 ビュー (過去 30 日間)
James Kempton
James Kempton 2019 年 10 月 14 日
コメント済み: Veronica Ati 2020 年 6 月 7 日
I am trying to change the data cursor size, colour and shape using the following code.
fig=gcf;
dcm_obj = datacursormode(fig);
set(dcm_obj,'enable','on','UpdateFcn',@data_tips)
hTarget = handle(fig);
hDatatip = cursorMode.createDatatip(hTarget);
set(hDatatip, 'MarkerSize',5, 'MarkerFaceColor','none', ...
'MarkerEdgeColor','k', 'Marker','o','HitTest','off');
However, I receive the following error:
Undefined variable "cursorMode" or class "cursorMode.createDatatip".
Error in figure_plotter (line 10)
hDatatip = cursorMode.createDatatip(hTarget);
Can anyone advise on the answer to my question, particularly by modifying the above code?

採用された回答

Vahila Kayithi
Vahila Kayithi 2019 年 12 月 26 日
You can change the properties of Data Cursor using the following commands:
alldatacursors = findall(gcf, 'type', 'hggroup', '-property', 'FontSize');
set(alldatacursors,'FontSize',12);
set(alldatacursors,'FontName','Times');
set(alldatacursors, 'FontWeight', 'bold');
For more information, refer to this link:
  2 件のコメント
James Kempton
James Kempton 2020 年 1 月 4 日
Thank you Vahila
Veronica Ati
Veronica Ati 2020 年 6 月 7 日
Thanks u

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by