      SUBROUTINE OFFSET(XOF,XFA,YOF,YFA)
C
C     NAME: OFFSET
C
C    LANGUAGE:  FORTRAN
C
C    OPERATING SYSTEM:  UNIVERSAL
C
C    ORDER NUMBER:  5428-SE
C
C    PART NUMBER:  000-026366  NOVEMBER 1985
C
C    PRODUCT:  UNIVERSAL VERSAPLOT COLOR RANDOM 2.0
C
C    VERSATEC, INC., SANTA CLARA, CALIFORNIA 95051
C    A XEROX COMPANY
C
C    Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
C
C    "NOTICE. THIS PROGRAM IS THE EXCLUSIVE PROPERTY OF VERSATEC,
C    INC. AND IS ISSUED IN STRICT CONFIDENCE UNDER A PREARRANGED
C    LICENSE AGREEMENT AND IS NOT TO BE DISCLOSED IN ANY MANNER TO
C    PERSONS OUTSIDE THE LICENSED ORGANIZATION AND SHALL NOT BE
C    REPRODUCED OR DISSEMINATED, IN WHOLE OR PART, TO ANYONE OUTSIDE
C    THE LICENSED ORGANIZATION WITHOUT THE PRIOR WRITTEN APPROVAL OF
C    VERSATEC, INC. UNLESS OTHERWISE PROVIDED FOR BY SUCH LICENSE
C    AGREEMENT.  THIS WORK IS PROTECTED AS AN UNPUBLISHED WORK UNDER
C    THE COPYRIGHT ACT OF 1976."
C
C     OFFSET - SET OFFSETS AND SCALING FACTOR
C
C     SUBROUTINE OFFSET ALLOWS THE USER TO SET SPECIAL SCALE FACTORS
C     AND OFFSETS TO BE USED BY PLOT CALLS WITH IPEN CODES +12 OR +13.
C     THESE VALUES ARE APPLIED TO THE INCOMING X,Y COORDINATES PRIOR
C     TO REGULAR SCALE FACTORS (i.e. SUBROUTINE FACTOR).  WHEN CALLING
C     PLOT WITH IPEN CODES +12 OR +13, THE INPUT COORDINATES ARE
C     ADJUSTED AS FOLLOWS:
C
C          X NEW =(X data-XOFF)/XFAC
C          Y NEW =(Y data-YOFF)/YFAC
C
C     ENTRY: CALL OFFSET(XOF,XFA,YOF,YFA)
C
C             XOF - X-OFFSET(REAL)
C             XFA - X SCALING FACTOR(REAL)
C                   IS USED WHEN PLOT IS CALLED
C                   WITH IPEN=+-12 OR +-13.
C             YOF - Y-OFFSET(REAL)
C             YFA - Y SCALING FACTOR(REAL)
C                   IS USED WHEN PLOT IS CALLED
C                   WITH IPEN=+-12 OR +-13.
C
C     EXIT: RETURN
C
C     CALLS: NONE
C
C     CALLED BY: USER
C
C     COMMON USED:
C     /DVCOM/
C            R XFAC    - SCALING FACTOR SET BY *OFFSET* AND USED BY
C                        *PLOT* FOR SCALED/OFFSET MOVES
C            R XOFF    - USED BY *OFFSET* AND *PLOT* IN DEFINING
C                        SCALED/OFFSET MOVES
C            R YFAC    - SCALING FACTOR SET BY *OFFSET* AND USED BY
C                        *PLOT* FOR SCALED/OFFSET MOVES
C            R YOFF    - USED BY *OFFSET* AND *PLOT* IN DEFINING
C                        SCALED/OFFSET MOVES.
C
C     /MSGCOM/
C            R RELARG()- ARRAY FOR PASSING REAL OUTPUT ARGUMENTS
C
C
C
C
      LOGICAL ROT90,PMOVE,IPDEF,DASHPN,XMAJOR,VSFLAG
      INTEGER PWIDTH,XNIPS,YNIPS,PENPAT,VSMAX,PFONT
C...  COMMON /DVCOM/  PHASE I COMMON VARIABLES
C
      COMMON /DVCOM/
     *         ANC,    DASHPN, FACT,   HTC,    ICUT,   ICWTV,  ICXPTS,
     *         IEOJ,   ILWM,   ILWP,   IOPEN,  ISORT,  ITFLAG, IX1,
     *         IX2,    IY1,    IY2,    JFONT,  JPEN,   KPAT,   KWIDTH,
     *         LASTX,  LASTY,  MAXPAT, MSB,    MSKALL, NCH,    NCLIP,
     *         NIBSX,  NLPAT,  NPLOT,  PFONT,  PMOVE,  PXMIN,  PXMAX,
     *         PYMIN,  PYMAX,  RADN,   ROT90,  SXC,    SYC,    TSINA,
     *         TCOSA,  XDEN,   XFAC,   XNIPS,  XOFF,   YDEN,   YFAC,
     *         YOFF,   YNIPS,  VSFLAG, VSMAX,  XMAJOR,
     *         IPAT(16,256), IEOP(4),  IHBUF(2), IPDEF(64),
     *         NPAT(255),    PENPAT(4,64), PWIDTH(64),
     *         RORG(2), VCP(2), VP(4), WIN(4), WTV(4), WX(4),  WY(4),
     *         IAUTXT(15)
C
C
C
C...  COMMON /MSGCOM/ - MESSAGE OUTPUT VARIABLES
C
      COMMON /MSGCOM/ INTARG(8), RELARG(12)
C
C
C-D   DEBUG MESSAGE
C      RELARG(1)=XOF
C      RELARG(2)=XFA
C      RELARG(3)=YOF
C      RELARG(4)=YFA
C      CALL MSGLG1(32)
C-D
C
C...  SET OFFSETS AND SCALING FACTORS
25    XOFF = XOF
      XFAC = XFA
      YOFF = YOF
      YFAC = YFA
C
C...  SCALING FACTORS ILLEGAL?
C     IF FACTORS ARE 0, MAKE THEM 1.  SINCE THEY ARE DIVIDED INTO DATA
C     VALUES IN PLOT, 0 VALUES ARE NOT ALLOWED.
      IF (XFAC.EQ.0.) XFAC = 1.
      IF (YFAC.EQ.0.) YFAC = 1.
C
      RETURN
C
      END
