;+ ; NAME: plot_drawzoombox ; PURPOSE: ; Draw zoom-in lines for a plot cutout. ; ; INPUTS: ; pixelx, pixely center of zoomed in box in image pixels ; pixelw size of zoomed-in box in image pixels ; KEYWORDS: ; xvals,yvals x and y value per pixel, such as from imdisp_getaxes ; OUTPUTS: ; ; HISTORY: ; Began 2007-06-02 23:18:26 by Marshall Perrin ;- PRO plot_drawzoombox, pixelx, pixely, pixelw, xvals=xvals,yvals=yvals, $ position=position, color=color, _extra=_extra, $ topleft=topleft, topright=topright, botleft=botleft, botright=botright if ~(keyword_set(color)) then color = fsc_color('black') ; convert from pixel coords to data coords bxx = xvals[pixelx] bxy = yvals[pixely] bxw = xvals[pixelx-pixelw/2] - xvals[pixelx+pixelw/2] ; convert from data coords to normal coords bn = convert_coord( [bxx-bxw/2,bxx-bxw/2,bxx+bxw/2,bxx+bxw/2], $ [bxy-bxw/2,bxy+bxw/2,bxy-bxw/2,bxy+bxw/2],/data,/to_normal) ;posd = convert_coord( [position[0], position[2]], [position[1],position[3]], /normal, /to_data) ; draw the tiny box plots, bn[0,[0,1,3,2,0]], bn[1,[0,1,3,2,0]],/normal,color=color,thick=th, _extra=_extra ; draw the lines connecting to the larger box if keyword_set(botleft) then plots,[bn[0,2],position[0]],[bn[1,2],position[1]],/normal,color=color,thick=th, _extra=_extra if keyword_set(botright) then plots,[bn[0,0],position[2]],[bn[1,0],position[1]],/normal,color=color,thick=th, _extra=_extra if keyword_set(topleft) then plots,[bn[0,3],position[0]],[bn[1,3],position[3]],/normal,color=color,thick=th, _extra=_extra if keyword_set(topright) then plots,[bn[0,1],position[2]],[bn[1,1],position[3]],/normal,color=color,thick=th, _extra=_extra end