      SUBROUTINE draw_axes(xmin,xmax,ymin,ymax)
*     number of tick marks
      IMPLICIT NONE
      REAL dx, dy, tx, ty, x, x0, y, y0, xmin, xmax, ymin, ymax
      INTEGER IR_, itick, ntick
      ntick = 10
*     dx distance between tick marks on x axis
      dx = (xmax - xmin)/ntick
*     dy distance between tick marks on y axis
      dy = (ymax - ymin)/ntick
*     include margin in window statement
      CALL GWindow(IR_, xmin - dx, ymin - dy, xmax + dx, ymax + dy)
      x0 = max(0,xmin)
      IF(ymin*ymax .LT. 0) THEN
         y0 = 0
      ELSE
         y0 = ymin
      END IF
      CALL GWline(IR_, xmin, y0, xmax, y0)  ! horizontal axis
      CALL GWline(IR_, x0, ymin, x0, ymax)  ! vertical axis
      tx = 0.1D0*dy                         ! size of tick mark
      ty = 0.1D0*dx
      DO itick = 0, ntick
         x = xmin + itick*dx
         CALL GWline(IR_, x, y0 - tx, x, y0 + tx)
                                            ! draw ticks on x axis
         y = ymin + itick*dy
         CALL GWline(IR_, x0 - ty, y, x0 + ty, y)
                                            ! draw ticks on y axis
      END DO
      END
