[datacursermode] Counter for data tips in a figure
Ältere Kommentare anzeigen
Hello everybody
I would like to have some kind of counter in my figure, that displays the number of data tips in my figure in real time. If I add a data tip the counter has to raise and if I delete a data tip the counter should decline.
Thanks in advance
Antworten (2)
Fritz
am 31 Okt. 2014
Sean de Wolski
am 31 Okt. 2014
In R2014b, you can look for found parts of the axes that are PointDataTips
fig = figure;
ax = gca;
plot(rand(1,10))
% add some data tips
ntip = 0;
h = findall(ax);
for ii = 1:numel(h)
ntip = ntip+isa(h(ii),'matlab.graphics.shape.internal.PointDataTip');
end
disp(ntip)
There's probably a similar thing you can search for in releases before 14b.
Kategorien
Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!