annotate arrows/@mousepos/mousepos.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
| author |
samer |
| date |
Sun, 11 Oct 2015 10:20:42 +0100 |
| parents |
beb8a3f4a345 |
| children |
|
| rev |
line source |
|
samer@0
|
1 % mousepos - Arrow that tracks the mouse position in some axes.
|
|
samer@0
|
2 %
|
|
samer@0
|
3 % mousepos ::
|
|
samer@0
|
4 % options {
|
|
samer@0
|
5 % fig :: handles / gcf ~'figure to track';
|
|
samer@0
|
6 % xlim :: [[1,2]] / [] ~'if not empty, set X limits of axes';
|
|
samer@0
|
7 % ylim :: [[1,2]] / [] ~'if not empty, set Y limits of axes'
|
|
samer@0
|
8 % }
|
|
samer@0
|
9 % -> arrow({},[[2,1]]),empty).
|
|
samer@0
|
10 %
|
|
samer@0
|
11 % The output of the mousepos arrow is a two element column vector
|
|
samer@0
|
12 % containing the X and Y coordinates of the current point in axes
|
|
samer@0
|
13 % coordinates.
|
|
samer@0
|
14
|
|
samer@0
|
15 function o=mousepos(varargin)
|
|
samer@37
|
16 s.opts=options('fig',[],'xlim',[],'ylim',[],varargin{:});
|
|
samer@0
|
17 if isempty(s.opts.fig), s.opts.fig=gcf; end
|
|
samer@0
|
18 o=class(s,'mousepos',arrow(0,1));
|
|
samer@0
|
19 end
|
|
samer@0
|
20
|