macro for drawing time plots