
(/VERSIONCHECK 2) 

(DEFUN |GRIMAGE;numberCheck| (|nums| $)
  (PROG (|i| #0=#:G1835 #1=#:G1831 #2=#:G1833)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |i| (SPADCALL |nums| (QREFELT $ 9))
                            . #3=(|GRIMAGE;numberCheck|))
                      (LETT #0# (SPADCALL |nums| (QREFELT $ 10)) . #3#)
                      G190 (COND ((> |i| #0#) (GO G191)))
                      (SEQ (EXIT (COND
                                   ((COMPLEXP
                                     (SPADCALL |nums|
                                      (PROG1 (LETT #1# |i| . #3#)
                                        (|check-subtype| (> #1# 0)
                                         '(|PositiveInteger|) #1#))
                                      (QREFELT $ 12)))
                                    (PROGN
                                      (LETT #2#
                                       (|error|
                                        "An unexpected complex number was encountered in the calculations.") . #3#)
                                      (GO #2#))))))
                      (LETT |i| (+ |i| 1) . #3#) (GO G190) G191
                      (EXIT NIL)))
           #2# (EXIT #2#))))) 

(DEFUN |GRIMAGE;doOptions| (|g| $)
  (PROG (|lr| |lu|)
    (RETURN
      (SEQ (LETT |lr|
                 (SPADCALL (QVELT |g| 7) (SPADCALL |g| (QREFELT $ 14))
                     (QREFELT $ 17))
                 . #0=(|GRIMAGE;doOptions|))
           (COND
             ((< 1 (LENGTH |lr|))
              (QSETVELT |g| 1
                  (LIST (SPADCALL
                            (SPADCALL
                                (SPADCALL
                                    (SPADCALL |lr| 1 (QREFELT $ 19))
                                    (QREFELT $ 21))
                                (QREFELT $ 22))
                            (SPADCALL
                                (SPADCALL
                                    (SPADCALL |lr| 1 (QREFELT $ 19))
                                    (QREFELT $ 23))
                                (QREFELT $ 22))
                            (QREFELT $ 25))
                        (SPADCALL
                            (SPADCALL
                                (SPADCALL
                                    (SPADCALL |lr| 2 (QREFELT $ 19))
                                    (QREFELT $ 21))
                                (QREFELT $ 22))
                            (SPADCALL
                                (SPADCALL
                                    (SPADCALL |lr| 2 (QREFELT $ 19))
                                    (QREFELT $ 23))
                                (QREFELT $ 22))
                            (QREFELT $ 25)))))
             ('T (QSETVELT |g| 1 NIL)))
           (LETT |lu|
                 (SPADCALL (QVELT |g| 7) (SPADCALL |g| (QREFELT $ 27))
                     (QREFELT $ 28)) . #0#)
           (EXIT (COND
                   ((< 1 (LENGTH |lu|))
                    (QSETVELT |g| 2
                        (LIST (SPADCALL
                                  (SPADCALL |lu| 1 (QREFELT $ 29))
                                  (QREFELT $ 22))
                              (SPADCALL
                                  (SPADCALL |lu| 2 (QREFELT $ 29))
                                  (QREFELT $ 22)))))
                   ('T (QSETVELT |g| 2 NIL)))))))) 

(DEFUN |GRIMAGE;putColorInfo;LLL;3| (|llp| |listOfPalettes| $)
  (PROG (|pal| #0=#:G1849 |lp| #1=#:G1848 |daHue| |daShade| #2=#:G1850
               |d| |p| |lp2| |llp2|)
    (RETURN
      (SEQ (LETT |llp2| NIL . #3=(|GRIMAGE;putColorInfo;LLL;3|))
           (SEQ (LETT |pal| NIL . #3#)
                (LETT #0# |listOfPalettes| . #3#) (LETT |lp| NIL . #3#)
                (LETT #1# |llp| . #3#) G190
                (COND
                  ((OR (ATOM #1#)
                       (PROGN (LETT |lp| (CAR #1#) . #3#) NIL)
                       (ATOM #0#)
                       (PROGN (LETT |pal| (CAR #0#) . #3#) NIL))
                   #4=(GO G191)))
                (SEQ (LETT |lp2| NIL . #3#)
                     (LETT |daHue|
                           (FLOAT (SPADCALL
                                      (SPADCALL |pal| (QREFELT $ 32))
                                      (QREFELT $ 33))
                                  MOST-POSITIVE-DOUBLE-FLOAT) . #3#)
                     (LETT |daShade|
                           (FLOAT (SPADCALL |pal| (QREFELT $ 34))
                                  MOST-POSITIVE-DOUBLE-FLOAT) . #3#)
                     (SEQ (LETT |p| NIL . #3#) (LETT #2# |lp| . #3#)
                          G190
                          (COND
                            ((OR (ATOM #2#)
                                 (PROGN
                                   (LETT |p| (CAR #2#) . #3#)
                                   NIL))
                             #4#))
                          (SEQ (SEQ (LETT |d|
                                     (SPADCALL |p| (QREFELT $ 36)) . #3#)
                                    (EXIT
                                     (COND
                                       ((< |d| 3)
                                        (LETT |p|
                                         (SPADCALL |p|
                                          (LIST |daHue| |daShade|)
                                          (QREFELT $ 38)) . #3#))
                                       ('T
                                        (SEQ
                                         (SPADCALL |p| 3 |daHue|
                                          (QREFELT $ 39))
                                         (EXIT
                                          (COND
                                            ((< |d| 4)
                                             (LETT |p|
                                              (SPADCALL |p|
                                               (LIST |daShade|)
                                               (QREFELT $ 38)) . #3#))
                                            ('T
                                             (SPADCALL |p| 4 |daShade|
                                              (QREFELT $ 39))))))))))
                               (EXIT (LETT |lp2|
                                      (CONS |p| |lp2|) . #3#)))
                          (LETT #2# (CDR #2#) . #3#) #5=(GO G190) G191
                          (EXIT NIL))
                     (EXIT (LETT |llp2|
                                 (CONS (NREVERSE |lp2|) |llp2|) . #3#)))
                (LETT #1#
                      (PROG1 (CDR #1#) (LETT #0# (CDR #0#) . #3#)) . #3#)
                #5# G191 (EXIT NIL))
           (EXIT (NREVERSE |llp2|)))))) 

(DEFUN |GRIMAGE;graph| (|demRanges| $)
  (PROG (|demRangesSF|)
    (RETURN
      (SEQ (COND
             ((NULL |demRanges|)
              (VECTOR 0 NIL NIL NIL NIL NIL NIL NIL))
             ('T
              (SEQ (LETT |demRangesSF|
                         (LIST (SPADCALL
                                   (SPADCALL
                                    (SPADCALL
                                     (SPADCALL |demRanges| 1
                                      (QREFELT $ 19))
                                     (QREFELT $ 21))
                                    (QREFELT $ 22))
                                   (SPADCALL
                                    (SPADCALL
                                     (SPADCALL |demRanges| 1
                                      (QREFELT $ 19))
                                     (QREFELT $ 23))
                                    (QREFELT $ 22))
                                   (QREFELT $ 25))
                               (SPADCALL
                                   (SPADCALL
                                    (SPADCALL
                                     (SPADCALL |demRanges| 1
                                      (QREFELT $ 19))
                                     (QREFELT $ 21))
                                    (QREFELT $ 22))
                                   (SPADCALL
                                    (SPADCALL
                                     (SPADCALL |demRanges| 1
                                      (QREFELT $ 19))
                                     (QREFELT $ 23))
                                    (QREFELT $ 22))
                                   (QREFELT $ 25)))
                         |GRIMAGE;graph|)
                   (EXIT (VECTOR 0 |demRangesSF| NIL NIL NIL NIL NIL
                                 NIL))))))))) 

(DEFUN |GRIMAGE;scaleStep| (|range| $)
  (PROG (|adjust| |tryStep| |numerals| |scaleDown|)
    (RETURN
      (SEQ (LETT |adjust| 0 . #0=(|GRIMAGE;scaleStep|))
           (SEQ G190
                (COND
                  ((NULL (< |range|
                            (SPADCALL
                                (SPADCALL 100 0 10 (QREFELT $ 43))
                                (QREFELT $ 44))))
                   (GO G191)))
                (SEQ (LETT |adjust| (+ |adjust| 1) . #0#)
                     (EXIT (LETT |range|
                                 (* |range|
                                    (SPADCALL
                                     (SPADCALL 10 0 10 (QREFELT $ 43))
                                     (QREFELT $ 44))) . #0#)))
                NIL (GO G190) G191 (EXIT NIL))
           (LETT |tryStep|
                 (/ |range|
                    (SPADCALL (SPADCALL 10 0 10 (QREFELT $ 43))
                              (QREFELT $ 44))) . #0#)
           (LETT |numerals|
                 (STRINGIMAGE
                     (SPADCALL (SPADCALL |tryStep| (QREFELT $ 45))
                         (QREFELT $ 46))) . #0#)
           (LETT |scaleDown|
                 (FLOAT (EXPT 10 (- (QCSIZE |numerals|) 1))
                        MOST-POSITIVE-DOUBLE-FLOAT) . #0#)
           (EXIT (/ (* |scaleDown|
                       (SPADCALL
                           (- (/ |tryStep| |scaleDown|)
                              (SPADCALL
                                  (SPADCALL 5 -1 10 (QREFELT $ 43))
                                  (QREFELT $ 44)))
                           (QREFELT $ 45)))
                    (FLOAT (EXPT 10 |adjust|)
                           MOST-POSITIVE-DOUBLE-FLOAT))))))) 

(DEFUN |GRIMAGE;figureUnits;LL;6| (|listOfListsOfPoints| $)
  (PROG (|pL| #0=#:G1870 |p| #1=#:G1871 |px| |py| |xMin| |xMax| |yMin|
              |yMax|)
    (RETURN
      (SEQ (LETT |xMin|
                 (LETT |xMax|
                       (SPADCALL
                           (|SPADfirst|
                               (|SPADfirst| |listOfListsOfPoints|))
                           (QREFELT $ 48))
                       . #2=(|GRIMAGE;figureUnits;LL;6|)) . #2#)
           (LETT |yMin|
                 (LETT |yMax|
                       (SPADCALL
                           (|SPADfirst|
                               (|SPADfirst| |listOfListsOfPoints|))
                           (QREFELT $ 49)) . #2#) . #2#)
           (COND
             ((SPADCALL |xMin| |xMin| (QREFELT $ 51))
              (LETT |xMin| MOST-POSITIVE-DOUBLE-FLOAT . #2#)))
           (COND
             ((SPADCALL |xMax| |xMax| (QREFELT $ 51))
              (LETT |xMax| MOST-NEGATIVE-DOUBLE-FLOAT . #2#)))
           (COND
             ((SPADCALL |yMin| |yMin| (QREFELT $ 51))
              (LETT |yMin| MOST-POSITIVE-DOUBLE-FLOAT . #2#)))
           (COND
             ((SPADCALL |yMax| |yMax| (QREFELT $ 51))
              (LETT |yMax| MOST-NEGATIVE-DOUBLE-FLOAT . #2#)))
           (SEQ (LETT |pL| NIL . #2#)
                (LETT #0# |listOfListsOfPoints| . #2#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |pL| (CAR #0#) . #2#) NIL))
                   #3=(GO G191)))
                (SEQ (EXIT (SEQ (LETT |p| NIL . #2#)
                                (LETT #1# |pL| . #2#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |p| (CAR #1#) . #2#)
                                      NIL))
                                   #3#))
                                (SEQ (SEQ
                                      (LETT |px|
                                       (SPADCALL |p| (QREFELT $ 48)) . #2#)
                                      (EXIT
                                       (COND
                                         ((< |px| |xMin|)
                                          (LETT |xMin| |px| . #2#)))))
                                     (COND
                                       ((< |xMax| |px|)
                                        (LETT |xMax| |px| . #2#)))
                                     (SEQ
                                      (LETT |py|
                                       (SPADCALL |p| (QREFELT $ 49)) . #2#)
                                      (EXIT
                                       (COND
                                         ((< |py| |yMin|)
                                          (LETT |yMin| |py| . #2#)))))
                                     (EXIT
                                      (COND
                                        ((< |yMax| |py|)
                                         (LETT |yMax| |py| . #2#)))))
                                (LETT #1# (CDR #1#) . #2#) #4=(GO G190)
                                G191 (EXIT NIL))))
                (LETT #0# (CDR #0#) . #2#) #4# G191 (EXIT NIL))
           (COND
             ((= |xMin| |xMax|)
              (SEQ (LETT |xMin|
                         (- |xMin|
                            (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 43))
                                (QREFELT $ 22))) . #2#)
                   (EXIT (LETT |xMax|
                               (+ |xMax|
                                  (SPADCALL
                                      (SPADCALL 5 -1 10 (QREFELT $ 43))
                                      (QREFELT $ 22))) . #2#)))))
           (COND
             ((= |yMin| |yMax|)
              (SEQ (LETT |yMin|
                         (- |yMin|
                            (SPADCALL (SPADCALL 5 -1 10 (QREFELT $ 43))
                                (QREFELT $ 22))) . #2#)
                   (EXIT (LETT |yMax|
                               (+ |yMax|
                                  (SPADCALL
                                      (SPADCALL 5 -1 10 (QREFELT $ 43))
                                      (QREFELT $ 22))) . #2#)))))
           (EXIT (LIST (|GRIMAGE;scaleStep| (- |xMax| |xMin|) $)
                       (|GRIMAGE;scaleStep| (- |yMax| |yMin|) $))))))) 

(DEFUN |GRIMAGE;plotLists|
       (|graf| |listOfListsOfPoints| |listOfPointColors|
               |listOfLineColors| |listOfPointSizes| $)
  (PROG (#0=#:G1897 |l| #1=#:G1898 |len| #2=#:G1879 #3=#:G1886
            |givenLen| #4=#:G1893)
    (RETURN
      (SEQ (LETT |givenLen| (LENGTH |listOfListsOfPoints|)
                 . #5=(|GRIMAGE;plotLists|))
           (LETT |listOfListsOfPoints|
                 (PROGN
                   (LETT #0# NIL . #5#)
                   (SEQ (LETT |l| NIL . #5#)
                        (LETT #1# |listOfListsOfPoints| . #5#) G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |l| (CAR #1#) . #5#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (COND
                                     ((COND
                                        ((NULL |l|) 'NIL)
                                        (#6='T 'T))
                                      (LETT #0# (CONS |l| #0#) . #5#)))))
                        (LETT #1# (CDR #1#) . #5#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #5#)
           (COND
             ((NULL |listOfListsOfPoints|)
              (|error| "GraphImage was given a list that contained no valid point lists")))
           (SEQ (LETT |len| (LENGTH |listOfListsOfPoints|) . #5#)
                (EXIT (COND
                        ((NULL (EQL |len| |givenLen|))
                         (|sayBrightly|
                             (LIST "   Warning: Ignoring pointless point list"))))))
           (QSETVELT |graf| 3 |listOfListsOfPoints|)
           (SEQ (LETT |givenLen| (LENGTH |listOfPointColors|) . #5#)
                (EXIT (COND
                        ((< |len| |givenLen|)
                         (QSETVELT |graf| 4
                             (SPADCALL |listOfPointColors|
                                 (SPADCALL
                                     (+
                                      (PROG1
                                       (LETT #2#
                                        (- |len| |givenLen|) . #5#)
                                        (|check-subtype| (>= #2# 0)
                                         '(|NonNegativeInteger|) #2#))
                                      1)
                                     (SPADCALL (QREFELT $ 54))
                                     (QREFELT $ 56))
                                 (QREFELT $ 57))))
                        (#6#
                         (QSETVELT |graf| 4
                             (SPADCALL |listOfPointColors| |len|
                                 (QREFELT $ 58)))))))
           (SEQ (LETT |givenLen| (LENGTH |listOfLineColors|) . #5#)
                (EXIT (COND
                        ((< |len| |givenLen|)
                         (QSETVELT |graf| 5
                             (SPADCALL |listOfLineColors|
                                 (SPADCALL
                                     (+
                                      (PROG1
                                       (LETT #3#
                                        (- |len| |givenLen|) . #5#)
                                        (|check-subtype| (>= #3# 0)
                                         '(|NonNegativeInteger|) #3#))
                                      1)
                                     (SPADCALL (QREFELT $ 59))
                                     (QREFELT $ 56))
                                 (QREFELT $ 57))))
                        (#6#
                         (QSETVELT |graf| 5
                             (SPADCALL |listOfLineColors| |len|
                                 (QREFELT $ 58)))))))
           (SEQ (LETT |givenLen| (LENGTH |listOfPointSizes|) . #5#)
                (EXIT (COND
                        ((< |len| |givenLen|)
                         (QSETVELT |graf| 6
                             (SPADCALL |listOfPointSizes|
                                 (SPADCALL
                                     (+
                                      (PROG1
                                       (LETT #4#
                                        (- |len| |givenLen|) . #5#)
                                        (|check-subtype| (>= #4# 0)
                                         '(|NonNegativeInteger|) #4#))
                                      1)
                                     (SPADCALL (QREFELT $ 60))
                                     (QREFELT $ 62))
                                 (QREFELT $ 63))))
                        (#6#
                         (QSETVELT |graf| 6
                             (SPADCALL |listOfPointSizes| |len|
                                 (QREFELT $ 64)))))))
           (EXIT |graf|))))) 

(DEFUN |GRIMAGE;makeGraph| (|graf| $)
  (PROG (|transform| |tonto| |s| #0=#:G1914 |lColor| #1=#:G1913
            |pColor| #2=#:G1912 |aList| #3=#:G1911 |p| #4=#:G1915
            |aPoint| |hueShade|)
    (RETURN
      (SEQ (|GRIMAGE;doOptions| |graf| $)
           (LETT |s| (LENGTH (QVELT |graf| 3))
                 . #5=(|GRIMAGE;makeGraph|))
           (EXIT (COND
                   ((EQL |s| 0)
                    (|error| "You are trying to make a graph with no points"))
                   ((NULL (EQL (SPADCALL |graf| (QREFELT $ 65)) 0))
                    (|error| "You are trying to draw over an existing graph"))
                   ('T
                    (SEQ (LETT |transform|
                               (SPADCALL (QVELT |graf| 7) (ELT $ 67)
                                   (QREFELT $ 69)) . #5#)
                         (QSETVELT |graf| 3
                             (SPADCALL (QVELT |graf| 3)
                                 (QVELT |graf| 4) (QREFELT $ 42)))
                         (COND
                           ((NULL (SPADCALL |graf| (QREFELT $ 14)))
                            (QSETVELT |graf| 1
                                (SPADCALL (QVELT |graf| 3)
                                    (QREFELT $ 72)))))
                         (COND
                           ((NULL (SPADCALL |graf| (QREFELT $ 27)))
                            (QSETVELT |graf| 2
                                (SPADCALL (QVELT |graf| 3)
                                    (QREFELT $ 52)))))
                         (|sayBrightly|
                             (LIST "   Graph data being transmitted to the viewport manager..."))
                         (|sockSendInt| |$ViewportServer| 2)
                         (|sockSendInt| |$ViewportServer| -1)
                         (LETT |tonto| (QVELT |graf| 1) . #5#)
                         (|sockSendFloat| |$ViewportServer|
                             (SPADCALL (|SPADfirst| |tonto|)
                                 (QREFELT $ 73)))
                         (|sockSendFloat| |$ViewportServer|
                             (SPADCALL (|SPADfirst| |tonto|)
                                 (QREFELT $ 74)))
                         (|sockSendFloat| |$ViewportServer|
                             (SPADCALL
                                 (SPADCALL |tonto| (QREFELT $ 75))
                                 (QREFELT $ 73)))
                         (|sockSendFloat| |$ViewportServer|
                             (SPADCALL
                                 (SPADCALL |tonto| (QREFELT $ 75))
                                 (QREFELT $ 74)))
                         (|sockSendFloat| |$ViewportServer|
                             (|SPADfirst| (QVELT |graf| 2)))
                         (|sockSendFloat| |$ViewportServer|
                             (SPADCALL (QVELT |graf| 2) (QREFELT $ 76)))
                         (|sockSendInt| |$ViewportServer| |s|)
                         (SEQ (LETT |s| NIL . #5#)
                              (LETT #0# (QVELT |graf| 6) . #5#)
                              (LETT |lColor| NIL . #5#)
                              (LETT #1# (QVELT |graf| 5) . #5#)
                              (LETT |pColor| NIL . #5#)
                              (LETT #2# (QVELT |graf| 4) . #5#)
                              (LETT |aList| NIL . #5#)
                              (LETT #3# (QVELT |graf| 3) . #5#) G190
                              (COND
                                ((OR (ATOM #3#)
                                     (PROGN
                                       (LETT |aList| (CAR #3#) . #5#)
                                       NIL)
                                     (ATOM #2#)
                                     (PROGN
                                       (LETT |pColor| (CAR #2#) . #5#)
                                       NIL)
                                     (ATOM #1#)
                                     (PROGN
                                       (LETT |lColor| (CAR #1#) . #5#)
                                       NIL)
                                     (ATOM #0#)
                                     (PROGN
                                       (LETT |s| (CAR #0#) . #5#)
                                       NIL))
                                 #6=(GO G191)))
                              (SEQ (|sockSendInt| |$ViewportServer|
                                    (LENGTH |aList|))
                                   (SEQ (LETT |p| NIL . #5#)
                                    (LETT #4# |aList| . #5#) G190
                                    (COND
                                      ((OR (ATOM #4#)
                                        (PROGN
                                          (LETT |p| (CAR #4#) . #5#)
                                          NIL))
                                       #6#))
                                    (SEQ
                                     (LETT |aPoint|
                                      (SPADCALL |p| |transform|) . #5#)
                                     (|sockSendFloat| |$ViewportServer|
                                      (SPADCALL |aPoint|
                                       (QREFELT $ 48)))
                                     (|sockSendFloat| |$ViewportServer|
                                      (SPADCALL |aPoint|
                                       (QREFELT $ 49)))
                                     (|sockSendFloat| |$ViewportServer|
                                      (SPADCALL |p| (QREFELT $ 77)))
                                     (EXIT
                                      (|sockSendFloat|
                                       |$ViewportServer|
                                       (SPADCALL |p| (QREFELT $ 78)))))
                                    (LETT #4# (CDR #4#) . #5#)
                                    #7=(GO G190) G191 (EXIT NIL))
                                   (LETT |hueShade|
                                    (+
                                     (SPADCALL
                                      (SPADCALL |pColor|
                                       (QREFELT $ 32))
                                      (QREFELT $ 33))
                                     (*
                                      (SPADCALL |pColor|
                                       (QREFELT $ 34))
                                      (SPADCALL (QREFELT $ 79)))) . #5#)
                                   (|sockSendInt| |$ViewportServer|
                                    |hueShade|)
                                   (LETT |hueShade|
                                    (+
                                     (SPADCALL
                                      (-
                                       (SPADCALL
                                        (SPADCALL |lColor|
                                         (QREFELT $ 32))
                                        (QREFELT $ 33))
                                       1)
                                      5 (QREFELT $ 81))
                                     (SPADCALL |lColor| (QREFELT $ 34))) . #5#)
                                   (|sockSendInt| |$ViewportServer|
                                    |hueShade|)
                                   (EXIT
                                    (|sockSendInt| |$ViewportServer|
                                     |s|)))
                              (LETT #3#
                                    (PROG1 (CDR #3#)
                                      (LETT #2#
                                       (PROG1 (CDR #2#)
                                         (LETT #1#
                                          (PROG1 (CDR #1#)
                                            (LETT #0# (CDR #0#) . #5#)) . #5#)) . #5#)) . #5#)
                              #7# G191 (EXIT NIL))
                         (QSETVELT |graf| 0
                             (|sockGetInt| |$ViewportServer|))
                         (EXIT |graf|))))))))) 

(DEFUN |GRIMAGE;makeGraphImage;2$;9| (|graf| $)
  (|GRIMAGE;makeGraph| |graf| $)) 

(PUT '|GRIMAGE;key;$I;10| '|SPADreplace|
     '(XLAM (|graf|) (QVELT |graf| 0))) 

(DEFUN |GRIMAGE;key;$I;10| (|graf| $) (QVELT |graf| 0)) 

(PUT '|GRIMAGE;pointLists;$L;11| '|SPADreplace|
     '(XLAM (|graf|) (QVELT |graf| 3))) 

(DEFUN |GRIMAGE;pointLists;$L;11| (|graf| $) (QVELT |graf| 3)) 

(DEFUN |GRIMAGE;ranges;$L;12| (|graf| $)
  (COND
    ((NULL (QVELT |graf| 1)) NIL)
    ('T
     (LIST (SPADCALL
               (SPADCALL
                   (SPADCALL
                       (SPADCALL (QVELT |graf| 1) 1 (QREFELT $ 84))
                       (QREFELT $ 73))
                   (QREFELT $ 85))
               (SPADCALL
                   (SPADCALL
                       (SPADCALL (QVELT |graf| 1) 1 (QREFELT $ 84))
                       (QREFELT $ 74))
                   (QREFELT $ 85))
               (QREFELT $ 86))
           (SPADCALL
               (SPADCALL
                   (SPADCALL
                       (SPADCALL (QVELT |graf| 1) 2 (QREFELT $ 84))
                       (QREFELT $ 73))
                   (QREFELT $ 85))
               (SPADCALL
                   (SPADCALL
                       (SPADCALL (QVELT |graf| 1) 2 (QREFELT $ 84))
                       (QREFELT $ 74))
                   (QREFELT $ 85))
               (QREFELT $ 86)))))) 

(DEFUN |GRIMAGE;ranges;$2L;13| (|graf| |rangesList| $)
  (SEQ (QSETVELT |graf| 1
           (LIST (SPADCALL
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL |rangesList| 1 (QREFELT $ 19))
                             (QREFELT $ 21))
                         (QREFELT $ 22))
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL |rangesList| 1 (QREFELT $ 19))
                             (QREFELT $ 23))
                         (QREFELT $ 22))
                     (QREFELT $ 25))
                 (SPADCALL
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL |rangesList| 2 (QREFELT $ 19))
                             (QREFELT $ 21))
                         (QREFELT $ 22))
                     (SPADCALL
                         (SPADCALL
                             (SPADCALL |rangesList| 2 (QREFELT $ 19))
                             (QREFELT $ 23))
                         (QREFELT $ 22))
                     (QREFELT $ 25))))
       (EXIT |rangesList|))) 

(DEFUN |GRIMAGE;units;$L;14| (|graf| $)
  (COND
    ((NULL (QVELT |graf| 2)) NIL)
    ('T
     (LIST (SPADCALL (SPADCALL (QVELT |graf| 2) 1 (QREFELT $ 88))
               (QREFELT $ 85))
           (SPADCALL (SPADCALL (QVELT |graf| 2) 2 (QREFELT $ 88))
               (QREFELT $ 85)))))) 

(DEFUN |GRIMAGE;units;$2L;15| (|graf| |unitsToBe| $)
  (SEQ (QSETVELT |graf| 2
           (LIST (SPADCALL (SPADCALL |unitsToBe| 1 (QREFELT $ 29))
                     (QREFELT $ 22))
                 (SPADCALL (SPADCALL |unitsToBe| 2 (QREFELT $ 29))
                     (QREFELT $ 22))))
       (EXIT |unitsToBe|))) 

(DEFUN |GRIMAGE;graphImage;$;16| ($) (|GRIMAGE;graph| NIL $)) 

(DEFUN |GRIMAGE;makeGraphImage;L$;17| (|llp| $)
  (PROG (#0=#:G1933 |l| #1=#:G1934 #2=#:G1935 #3=#:G1936 |i|)
    (RETURN
      (SEQ (SPADCALL |llp|
               (PROGN
                 (LETT #0# NIL . #4=(|GRIMAGE;makeGraphImage;L$;17|))
                 (SEQ (LETT |i| 1 . #4#)
                      (LETT #1# (LETT |l| (LENGTH |llp|) . #4#) . #4#)
                      G190 (COND ((QSGREATERP |i| #1#) #5=(GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS (SPADCALL (QREFELT $ 54))
                                        #0#) . #4#)))
                      (LETT |i| (QSADD1 |i|) . #4#) #6=(GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (PROGN
                 (LETT #2# NIL . #4#)
                 (SEQ (LETT |i| 1 . #4#) G190
                      (COND ((QSGREATERP |i| |l|) #5#))
                      (SEQ (EXIT (LETT #2#
                                       (CONS (SPADCALL (QREFELT $ 59))
                                        #2#) . #4#)))
                      (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                      (EXIT (NREVERSE0 #2#))))
               (PROGN
                 (LETT #3# NIL . #4#)
                 (SEQ (LETT |i| 1 . #4#) G190
                      (COND ((QSGREATERP |i| |l|) #5#))
                      (SEQ (EXIT (LETT #3#
                                       (CONS (SPADCALL (QREFELT $ 60))
                                        #3#) . #4#)))
                      (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                      (EXIT (NREVERSE0 #3#))))
               (QREFELT $ 92)))))) 

(DEFUN |GRIMAGE;makeGraphImage;L2LL$;18| (|llp| |lpc| |llc| |lps| $)
  (SPADCALL |llp| |lpc| |llc| |lps| NIL (QREFELT $ 94))) 

(DEFUN |GRIMAGE;makeGraphImage;L2LLL$;19|
       (|llp| |lpc| |llc| |lps| |opts| $)
  (PROG (|graf| |transform| |aList| #0=#:G1943 |p| #1=#:G1944 |aPoint|)
    (RETURN
      (SEQ (LETT |graf|
                 (|GRIMAGE;graph| (SPADCALL |opts| NIL (QREFELT $ 17))
                     $)
                 . #2=(|GRIMAGE;makeGraphImage;L2LLL$;19|))
           (QSETVELT |graf| 7 |opts|)
           (LETT |graf|
                 (|GRIMAGE;plotLists| |graf| |llp| |lpc| |llc| |lps| $) . #2#)
           (LETT |transform|
                 (SPADCALL (QVELT |graf| 7) (ELT $ 67) (QREFELT $ 69)) . #2#)
           (SEQ (LETT |aList| NIL . #2#)
                (LETT #0# (QVELT |graf| 3) . #2#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |aList| (CAR #0#) . #2#) NIL))
                   #3=(GO G191)))
                (SEQ (EXIT (SEQ (LETT |p| NIL . #2#)
                                (LETT #1# |aList| . #2#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |p| (CAR #1#) . #2#)
                                      NIL))
                                   #3#))
                                (SEQ (LETT |aPoint|
                                      (SPADCALL |p| |transform|) . #2#)
                                     (EXIT
                                      (|GRIMAGE;numberCheck| |aPoint|
                                       $)))
                                (LETT #1# (CDR #1#) . #2#) #4=(GO G190)
                                G191 (EXIT NIL))))
                (LETT #0# (CDR #0#) . #2#) #4# G191 (EXIT NIL))
           (EXIT (|GRIMAGE;makeGraph| |graf| $)))))) 

(DEFUN |GRIMAGE;component;$L2PPiV;20|
       (|graf| |ListOfPoints| |PointColor| |LineColor| |PointSize| $)
  (SEQ (QSETVELT |graf| 3
           (APPEND (QVELT |graf| 3) (LIST |ListOfPoints|)))
       (QSETVELT |graf| 4
           (APPEND (QVELT |graf| 4) (LIST |PointColor|)))
       (QSETVELT |graf| 5 (APPEND (QVELT |graf| 5) (LIST |LineColor|)))
       (EXIT (QSETVELT |graf| 6
                 (APPEND (QVELT |graf| 6) (LIST |PointSize|)))))) 

(DEFUN |GRIMAGE;component;$PV;21| (|graf| |aPoint| $)
  (SPADCALL |graf| |aPoint| (SPADCALL (QREFELT $ 54))
      (SPADCALL (QREFELT $ 59)) (SPADCALL (QREFELT $ 60))
      (QREFELT $ 98))) 

(DEFUN |GRIMAGE;component;$P2PPiV;22|
       (|graf| |aPoint| |PointColor| |LineColor| |PointSize| $)
  (SPADCALL |graf| (LIST |aPoint|) |PointColor| |LineColor| |PointSize|
      (QREFELT $ 97))) 

(DEFUN |GRIMAGE;appendPoint;$PV;23| (|graf| |aPoint| $)
  (PROG (|num|)
    (RETURN
      (SEQ (LETT |num| (- (LENGTH (QVELT |graf| 3)) 1)
                 |GRIMAGE;appendPoint;$PV;23|)
           (EXIT (COND
                   ((< |num| 0)
                    (|error| "No point lists to append to!"))
                   ('T
                    (SPADCALL (QVELT |graf| 3) |num|
                        (APPEND (SPADCALL (QVELT |graf| 3) |num|
                                    (QREFELT $ 100))
                                (LIST |aPoint|))
                        (QREFELT $ 101))))))))) 

(DEFUN |GRIMAGE;point;$PPV;24| (|graf| |aPoint| |PointColor| $)
  (SPADCALL |graf| |aPoint| |PointColor| (SPADCALL (QREFELT $ 59))
      (SPADCALL (QREFELT $ 60)) (QREFELT $ 98))) 

(DEFUN |GRIMAGE;coerce;L$;25| (|llp| $)
  (PROG (#0=#:G1957 |l| #1=#:G1958 #2=#:G1959 #3=#:G1960 |i|)
    (RETURN
      (SEQ (SPADCALL |llp|
               (PROGN
                 (LETT #0# NIL . #4=(|GRIMAGE;coerce;L$;25|))
                 (SEQ (LETT |i| 1 . #4#)
                      (LETT #1# (LETT |l| (LENGTH |llp|) . #4#) . #4#)
                      G190 (COND ((QSGREATERP |i| #1#) #5=(GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS (SPADCALL (QREFELT $ 54))
                                        #0#) . #4#)))
                      (LETT |i| (QSADD1 |i|) . #4#) #6=(GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (PROGN
                 (LETT #2# NIL . #4#)
                 (SEQ (LETT |i| 1 . #4#) G190
                      (COND ((QSGREATERP |i| |l|) #5#))
                      (SEQ (EXIT (LETT #2#
                                       (CONS (SPADCALL (QREFELT $ 59))
                                        #2#) . #4#)))
                      (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                      (EXIT (NREVERSE0 #2#))))
               (PROGN
                 (LETT #3# NIL . #4#)
                 (SEQ (LETT |i| 1 . #4#) G190
                      (COND ((QSGREATERP |i| |l|) #5#))
                      (SEQ (EXIT (LETT #3#
                                       (CONS (SPADCALL (QREFELT $ 60))
                                        #3#) . #4#)))
                      (LETT |i| (QSADD1 |i|) . #4#) #6# G191
                      (EXIT (NREVERSE0 #3#))))
               (QREFELT $ 92)))))) 

(DEFUN |GRIMAGE;coerce;$Of;26| (|graf| $)
  (PROG (|p|)
    (RETURN
      (SPADCALL
          (LIST "Graph with "
                (SPADCALL
                    (LETT |p| (LENGTH (SPADCALL |graf| (QREFELT $ 83)))
                          |GRIMAGE;coerce;$Of;26|)
                    (QREFELT $ 106))
                (COND ((EQL |p| 1) " point list") ('T " point lists")))
          (QREFELT $ 108))))) 

(DEFUN |GraphImage| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1963)
        (RETURN
          (COND
            ((LETT #0# (HGET |$ConstructorCache| '|GraphImage|)
                   . #1=(|GraphImage|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache| '|GraphImage|
                                   (LIST
                                    (CONS NIL (CONS 1 (|GraphImage;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#) (HREM |$ConstructorCache| '|GraphImage|))))))))))) 

(DEFUN |GraphImage;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|GraphImage|) . #0=(|GraphImage|))
        (LETT $ (GETREFV 111) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|GraphImage| NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6
            (|Record| (|:| |key| (|Integer|))
                (|:| |rangesField|
                     (|List| (|Segment| (|DoubleFloat|))))
                (|:| |unitsField| (|List| (|DoubleFloat|)))
                (|:| |llPoints|
                     (|List| (|List| (|Point| (|DoubleFloat|)))))
                (|:| |pointColors| (|List| (|Palette|)))
                (|:| |lineColors| (|List| (|Palette|)))
                (|:| |pointSizes| (|List| (|PositiveInteger|)))
                (|:| |optionsField| (|List| (|DrawOption|)))))
        $)))) 

(MAKEPROP '|GraphImage| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL '|Rep| (|Integer|) (|Point| 11)
             (0 . |minIndex|) (5 . |maxIndex|) (|DoubleFloat|)
             (10 . |elt|) (|List| 18) |GRIMAGE;ranges;$L;12|
             (|List| (|DrawOption|)) (|DrawOptionFunctions0|)
             (16 . |ranges|) (|Segment| 20) (22 . |elt|) (|Float|)
             (28 . |lo|) (33 . |convert|) (38 . |hi|) (|Segment| 11)
             (43 . |segment|) (|List| 20) |GRIMAGE;units;$L;14|
             (49 . |units|) (55 . |elt|) (|Color|) (|Palette|)
             (61 . |hue|) (66 . |hue|) (71 . |shade|)
             (|PositiveInteger|) (76 . |dimension|) (|List| 11)
             (81 . |extend|) (87 . |setelt|) (|List| 96) (|List| 31)
             |GRIMAGE;putColorInfo;LLL;3| (94 . |float|)
             (101 . |coerce|) (106 . |ceiling|) (111 . |retract|)
             (|PointPackage| 11) (116 . |xCoord|) (121 . |yCoord|)
             (|Boolean|) (126 . ~=) |GRIMAGE;figureUnits;LL;6|
             (|ViewDefaultsPackage|) (132 . |pointColorDefault|)
             (|NonNegativeInteger|) (136 . |new|) (142 . |concat|)
             (148 . |first|) (154 . |lineColorDefault|)
             (158 . |pointSizeDefault|) (|List| 35) (162 . |new|)
             (168 . |concat|) (174 . |first|) |GRIMAGE;key;$I;10|
             (|CoordinateSystems| 11) (180 . |cartesian|)
             (|Mapping| 8 8) (185 . |coord|) (|List| 24) (|PlotTools|)
             (191 . |calcRanges|) (196 . |lo|) (201 . |hi|)
             (206 . |second|) (211 . |second|) (216 . |hue|)
             (221 . |shade|) (226 . |numberOfHues|) (|SingleInteger|)
             (230 . *) |GRIMAGE;makeGraphImage;2$;9|
             |GRIMAGE;pointLists;$L;11| (236 . |elt|) (242 . |convert|)
             (247 . |segment|) |GRIMAGE;ranges;$2L;13| (253 . |elt|)
             (259 . |One|) |GRIMAGE;units;$2L;15|
             |GRIMAGE;graphImage;$;16|
             |GRIMAGE;makeGraphImage;L2LL$;18|
             |GRIMAGE;makeGraphImage;L$;17|
             |GRIMAGE;makeGraphImage;L2LLL$;19| (|Void|) (|List| 8)
             |GRIMAGE;component;$L2PPiV;20|
             |GRIMAGE;component;$P2PPiV;22| |GRIMAGE;component;$PV;21|
             (263 . |elt|) (269 . |setelt|)
             |GRIMAGE;appendPoint;$PV;23| |GRIMAGE;point;$PPV;24|
             |GRIMAGE;coerce;L$;25| (|OutputForm|) (276 . |coerce|)
             (|List| $) (281 . |hconcat|) |GRIMAGE;coerce;$Of;26|
             (|String|))
          '#(~= 286 |units| 292 |ranges| 303 |putColorInfo| 314
             |pointLists| 320 |point| 325 |makeGraphImage| 332 |latex|
             359 |key| 364 |hash| 369 |graphImage| 374 |figureUnits|
             378 |component| 383 |coerce| 407 |appendPoint| 417 = 423)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0))
                (CONS '#(|SetCategory&| |BasicType&| NIL)
                      (CONS '#((|SetCategory|) (|BasicType|)
                               (|CoercibleTo| 105))
                            (|makeByteWordVec2| 110
                                '(1 8 7 0 9 1 8 7 0 10 2 8 11 0 7 12 2
                                  16 13 15 13 17 2 13 18 0 7 19 1 18 20
                                  0 21 1 20 11 0 22 1 18 20 0 23 2 24 0
                                  11 11 25 2 16 26 15 26 28 2 26 20 0 7
                                  29 1 31 30 0 32 1 30 7 0 33 1 31 7 0
                                  34 1 8 35 0 36 2 8 0 0 37 38 3 8 11 0
                                  7 11 39 3 20 0 7 7 35 43 1 20 11 0 44
                                  1 11 0 0 45 1 11 7 0 46 1 47 11 8 48
                                  1 47 11 8 49 2 11 50 0 0 51 0 53 31
                                  54 2 41 0 55 31 56 2 41 0 0 0 57 2 41
                                  0 0 55 58 0 53 31 59 0 53 35 60 2 61
                                  0 55 35 62 2 61 0 0 0 63 2 61 0 0 55
                                  64 1 66 8 8 67 2 16 68 15 68 69 1 71
                                  70 40 72 1 24 11 0 73 1 24 11 0 74 1
                                  70 24 0 75 1 37 11 0 76 1 47 11 8 77
                                  1 47 11 8 78 0 30 35 79 2 80 0 7 0 81
                                  2 70 24 0 7 84 1 20 0 11 85 2 18 0 20
                                  20 86 2 37 11 0 7 88 0 20 0 89 2 40
                                  96 0 7 100 3 40 96 0 7 96 101 1 55
                                  105 0 106 1 105 0 107 108 2 0 50 0 0
                                  1 2 0 26 0 26 90 1 0 26 0 27 1 0 13 0
                                  14 2 0 13 0 13 87 2 0 40 40 41 42 1 0
                                  40 0 83 3 0 95 0 8 31 103 5 0 0 40 41
                                  41 61 15 94 4 0 0 40 41 41 61 92 1 0
                                  0 0 82 1 0 0 40 93 1 0 110 0 1 1 0 7
                                  0 65 1 0 80 0 1 0 0 0 91 1 0 37 40 52
                                  5 0 95 0 8 31 31 35 98 2 0 95 0 8 99
                                  5 0 95 0 96 31 31 35 97 1 0 0 40 104
                                  1 0 105 0 109 2 0 95 0 8 102 2 0 50 0
                                  0 1)))))
          '|lookupComplete|)) 

(MAKEPROP '|GraphImage| 'NILADIC T) 
