NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/basics/gcp.m

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 %       Written by: Brian O. Blanton
29
30 hf = get(get(0,'CurrentFigure'),'CurrentPoint');
31 ha = get(get(get(0,'CurrentFigure'),'CurrentAxes'),'CurrentPoint');
32
33 h=[hf;ha(1) ha(3)];
34
35 %
36 %        Brian O. Blanton
37 %        Curriculum in Marine Sciences
38 %        15-1A Venable Hall
39 %        CB# 3300
40 %        Uni. of North Carolina
41 %        Chapel Hill, NC
42 %                 27599-3300
43 %
44 %        919-962-4466
45 %        blanton@marine.unc.edu
46 %
47 %        FALL 95
48 %
Note: See TracBrowser for help on using the browser.