Are you using the rect({...}) command in a graphics script to draw inside of a graph? Or are you using an annotation rectangle (typically from the toolbar, but also scriptable) to draw a rectangle on top of a report (not just inside a graph)? Annotations, including the rectangle, have a parent displaybox that they are relative to. Using the right parent as an anchor will help.
Rect({...}) in a graphic script is usually with respect to the graph's coordinates, and Jim's suggestions are correct.
Craige