-
Notifications
You must be signed in to change notification settings - Fork 42
/
mtools.m
50 lines (45 loc) · 1.8 KB
/
mtools.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%MTOOLS add simple/useful tools to all windows in figure
%
% Copyright (C) 1993-2017, by Peter I. Corke
%
% This file is part of The Robotics Toolbox for MATLAB (RTB).
%
% RTB is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% RTB is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU Lesser General Public License for more details.
%
% You should have received a copy of the GNU Leser General Public License
% along with RTB. If not, see <http://www.gnu.org/licenses/>.
%
% http://www.petercorke.com
function mtools
global DDXFILENAME
h = uicontextmenu;
uimenu(h, 'Label', 'X zoom', 'CallBack', 'xaxis');
uimenu(h, 'Label', '-->', 'CallBack', 'xscroll(0.5)');
uimenu(h, 'Label', '<--', 'CallBack', 'xscroll(-0.5)');
uimenu(h, 'Label', 'CrossHairs', 'CallBack', 'crosshair');
uimenu(h, 'Label', 'X UNzoom', 'CallBack', 'unzoom');
uimenu(h, 'Label', 'Pick delta', 'CallBack', 'fprintf(''%f %f\n'', diff(ginput(2)))');
uimenu(h, 'Label', 'Line fit', 'CallBack', 'ilinefit');
uimenu(h, 'Label', 'Show points', 'CallBack', 'showpoints(gca)');
uimenu(h, 'Label', 'Apply X zoom to all', 'CallBack', 'xaxisall');
for c=get(gcf, 'Children')',
set(c, 'UIContextMenu', h);
l = get(c, 'Children');
end
axes('pos', [0 0 1 0.05], 'visible', 'off')
if 0
if ~isempty(DDXFILENAME),
s = sprintf('[%s] %s', DDXFILENAME, date);
else
s = sprintf('%s', date);
end
text(0.95, 0.1, s, 'horizontalalign', 'right', 'verticalalign', 'baseli')
end