select a box region on figure
09:26 / Comments (0) / by sswidl
Sometimes it is useful to choose a box region on a figure, e.g. to choose an interesting (normally a smaller) region to get XY coordinates for further analysis. In this case, you may try select_box.pro routine.
---- Module: select_box.pro
---- From: $SSW/gen/idl/display
---> Call: PRO SELECT_BOX,MX,MY,IX,IY,DATA=DATA,INIT=INIT,FIXED_SIZE=FIXED_SIZE
; Outputs :
; MX, MY = Size of selected box, in device coordinates.
; IX, IY = Coordinates of lower left-hand corner of selected box.
; Keywords :
; DATA = If this keyword is set, then the values are in returned in
; data coordinates instead of device coordinates.
;
; The following keywords are only relevant when used on a graphics device
; that supports windows:
;
; INIT = If this keyword is set, MX, MY, and IX, IY contain the
; initial parameters for the box.
;
; FIXED_SIZE = If this keyword is set, MX and MY contain the initial size
; of the box. This size may not be changed by the user.
; Operation is as follows:
; Left mouse button: Move the box by dragging.
; Middle mouse button: Resize the box by dragging. The corner
; nearest the initial mouse position is moved.
; Right mouse button: Exit this procedure, returning the
; current box parameters.
Example:
IDL> plot_image,dist(200,100)
IDL> select_box,MX,MY,IX,IY,/data
IDL> print,MX,MY,IX,IY
62.6728 39.1705 26.2269 40.7431
(Unit: pixel)
---- Module: select_box.pro
---- From: $SSW/gen/idl/display
---> Call: PRO SELECT_BOX,MX,MY,IX,IY,DATA=DATA,INIT=INIT,FIXED_SIZE=FIXED_SIZE
; Outputs :
; MX, MY = Size of selected box, in device coordinates.
; IX, IY = Coordinates of lower left-hand corner of selected box.
; Keywords :
; DATA = If this keyword is set, then the values are in returned in
; data coordinates instead of device coordinates.
;
; The following keywords are only relevant when used on a graphics device
; that supports windows:
;
; INIT = If this keyword is set, MX, MY, and IX, IY contain the
; initial parameters for the box.
;
; FIXED_SIZE = If this keyword is set, MX and MY contain the initial size
; of the box. This size may not be changed by the user.
; Operation is as follows:
; Left mouse button: Move the box by dragging.
; Middle mouse button: Resize the box by dragging. The corner
; nearest the initial mouse position is moved.
; Right mouse button: Exit this procedure, returning the
; current box parameters.
Example:
IDL> plot_image,dist(200,100)
IDL> select_box,MX,MY,IX,IY,/data
IDL> print,MX,MY,IX,IY
62.6728 39.1705 26.2269 40.7431
(Unit: pixel)
Posted in:
Submit Article :- BlinkList + Blogmarks + Digg + Del.icio.us + Ekstreme Socializer + Feedmarker + Furl + Google Bookmarks + ma.gnolia + Netvouz + RawSugar + Reddit + Scuttle + Shadows + Simpy + Spurl + Technorati + Unalog + Wink
This entry was posted on 09:26 and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
0 comments:
Post a Comment