Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
function h = gcp |
---|
2 |
%GCP Get current point on current axes and current figure. |
---|
3 |
% H = GCP returns two sets of points: |
---|
4 |
% 1) the current point on the current figure; |
---|
5 |
% 2) the current 2-D point on the current axes. |
---|
6 |
% |
---|
7 |
% The current point is the last place on an axes that a mouse |
---|
8 |
% button was pressed (or released if dragged). |
---|
9 |
% |
---|
10 |
% The first set (figure point) is not useful for most purposes. |
---|
11 |
% The second set (axes point) can be used to get the axes location |
---|
12 |
% at which to place text strings for labelling. |
---|
13 |
% |
---|
14 |
% The current points are returned in a 2X2 matrix, with the units |
---|
15 |
% specified by the figure (axes) property 'Units', as: |
---|
16 |
% |
---|
17 |
% | | |
---|
18 |
% | Fig_X Fig_Y | |
---|
19 |
% | | |
---|
20 |
% | Axes_X Axes_Y | |
---|
21 |
% | | |
---|
22 |
% |
---|
23 |
% The figure units are most likely to be in pixels. |
---|
24 |
% |
---|
25 |
% See the MATLAB Reference Guide for details on the 'CurrentPoint' |
---|
26 |
% property of figures and axes. |
---|
27 |
% |
---|
28 |
% Calls: none |
---|
29 |
|
---|
30 |
% Written by: Brian O. Blanton |
---|
31 |
|
---|
32 |
hf = get(get(0,'CurrentFigure'),'CurrentPoint'); |
---|
33 |
ha = get(get(get(0,'CurrentFigure'),'CurrentAxes'),'CurrentPoint'); |
---|
34 |
|
---|
35 |
h=[hf;ha(1) ha(3)]; |
---|
36 |
|
---|
37 |
% |
---|
38 |
% Brian O. Blanton |
---|
39 |
% Curriculum in Marine Sciences |
---|
40 |
% 15-1A Venable Hall |
---|
41 |
% CB# 3300 |
---|
42 |
% Uni. of North Carolina |
---|
43 |
% Chapel Hill, NC |
---|
44 |
% 27599-3300 |
---|
45 |
% |
---|
46 |
% 919-962-4466 |
---|
47 |
% blanton@marine.unc.edu |
---|
48 |
% |
---|
49 |
% FALL 95 |
---|
50 |
% |
---|