;+ ; NAME: ; LEGPOS ; PURPOSE: ; Determine normal coordinates of upper left corner of plot, ; for positioning a legend. ; CATEGORY: ; ; CALLING SEQUENCE: ; result = LEGPOS() ; INPUTS: ; None. ; OPTIONAL INPUTS: ; None. ; KEYWORD PARAMETERS: ; None. ; OUTPUTS: ; result: A 2-element row vector giving the normal coordinates ; of the upper left hand corner of the current plot. ; OPTIONAL OUTPUTS: ; None. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; None. ; RESTRICTIONS: ; A plot must be defined. ; PROCEDURE: ; The CLIP field of the !P system variable contains the DEVICE ; coordinates of the current plot. These are converted to ; NORMAL coordinates using CONVERT_COORD. ; EXAMPLE: ; !P.MULTI=[0,2,0,0,0] ; set up for 2 plots across the page ; PLOT,x,y1 ; create the first plot ; legend,['stuff'] $ ; Create a plot legend: ; ,psym=psym $ ; with plot symbols, ; ,linestyle=l $ ; and line styles. ; ,pos=legpos() ; Call to LEGPOS returns the positioning ; ; information needed ; ; SEE ALSO: ; LEGEND.PRO ; MODIFICATION HISTORY: ; Written by: D P Steele, 13 Oct 1994. ;- FUNCTION legpos xdvpos=!P.CLIP(0) ydvpos=!P.CLIP(3) npos=CONVERT_COORD([xdvpos,ydvpos],/DEVICE,/TO_NORMAL) RETURN,npos(0:1) END