comparison m-toolbox/classes/+utils/@plottools/datacursormode.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1
2
3 function output_txt = datacursormode(obj, event_obj)
4 % Display the position of the data cursor
5 % obj Currently not used (empty)
6 % event_obj Handle to event object
7 % output_txt Data cursor text string (string or cell array of strings).
8
9 t0 = get(get(get(event_obj, 'Target'), 'Parent'), 'UserData');
10
11 pos = get(event_obj,'Position');
12
13 output_txt = {['X: ',char(t0 + pos(1))],...
14 ['Y: ',num2str(pos(2),4)]};
15
16 % If there is a Z-coordinate in the position, display it as well
17 if length(pos) > 2
18 output_txt{end+1} = ['Z: ',num2str(pos(3),4)];
19 end
20
21 output_txt{end+1} = ['x-value: ', num2str(pos(1),4)];