Filter löschen
Filter löschen

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

17 Ansichten (letzte 30 Tage)
James Kempton
James Kempton am 14 Okt. 2019
Kommentiert: Veronica Ati am 7 Jun. 2020
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?

Akzeptierte Antwort

Vahila Kayithi
Vahila Kayithi am 26 Dez. 2019
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:

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by