;+ ; NAME: plot_rectangle ; PURPOSE: ; Draws a rectangle in data coordinates, optionally rotated ; ; INPUTS: ; KEYWORDS: ; rot rotation angle in DEGREES ; OUTPUTS: ; ; HISTORY: ; Began 2005-03-08 14:04:11 by Marshall Perrin ;- PRO plot_rectangle,width,height,xcen,ycen,rot=rot,$ _extra=_extra if ~(keyword_set(rot)) then rot=0 dx = width/2.0 dy = height/2.0 theta = rot*!dtor v2 = [[cos(theta),sin(theta)],[-sin(theta),cos(theta)]]##$ [[-dx,dx,dx,-dx,-dx],[-dy,-dy,dy,dy,-dy]] oplot,v2[*,0]+xcen,v2[*,1]+ycen,_extra=_extra end