h40750
s 00010/00003/00151
d D 1.6 83/03/15 13:09:05 mjb 6 5
c fixed bugs with labeling legends and calculating ranges
e
s 00001/00001/00153
d D 1.5 83/03/08 18:44:05 mjb 5 4
c 
e
s 00001/00001/00153
d D 1.4 83/03/08 17:03:54 mjb 4 3
c 
e
s 00020/00010/00134
d D 1.3 83/03/04 13:45:08 mjb 3 2
c 
e
s 00053/00050/00091
d D 1.2 83/03/03 17:37:40 mjb 2 1
c fixed bugs with x/y plotting and logarithmic axis stuff
e
s 00141/00000/00000
d D 1.1 83/03/02 22:26:57 mjb 1 0
c date and time created 83/03/02 22:26:57 by mjb
e
u
mjb
tes
U
t
T
I 1
subroutine graphb
########################################################################
#                                                                      #
#          THIS MATERIAL IS CONFIDENTIAL AND IS FURNISHED UNDER        #
#          A WRITTEN LICENSE AGREEMENT.  IT MAY NOT BE USED,           #
#          COPIED OR DISCLOSED TO OTHERS EXCEPT IN ACCORDANCE          #
#          WITH THE TERMS OF THAT AGREEMENT.                           #
#                                                                      #
#          COPYRIGHT (C) 1982 GRAPHIC SOFTWARE SYSTEMS INC.            #
#          ALL RIGHTS RESERVED.                                        #
#                                                                      #
#     Function: Output all axis and titles for a graph                 #
#                                                                      #
#     Input Parameters:                                                #
#            None                                                      #
#                                                                      #
#     Output Parameters:                                               #
#            None                                                      #
#                                                                      #
#     Routines Called:                                                 #
#            None                                                      #
#                                                                      #
########################################################################

D 6
integer i, j, k, type, itics, dtics
E 6
I 6
integer i, j, k, n, type, itics, dtics
E 6

include(`gattcom')

# Assumptions:
#   - the common block 'gphcom' has been updated and properly set for
#     outputting a graph       

D 2
call xylatt (gfont(5), zchrsz(5), gcolor(5))
E 2
I 2
if (maxpts > 0) {
   
   call xylatt (gfont(5), zchrsz(5), gcolor(5))
E 2

D 2
if (bgbard(1) == BIGV) {
   call xtcpos (zistic, zietic)              # Set tic positions
   call ytcpos (zdstic, zdetic)   
   }
else {
   call ytcpos (zistic, zietic)              # Set tic positions
   call xtcpos (zdstic, zdetic)   
   }

itics = bgntic
if (bgaxis(1) == BIGP) {
   itics = 1
   if (bgptic(1) == BIGN) itics = 0
   }
dtics = bgdtic

if (bgbard(1) == BIGV) {
   if (bgaxis(1) == BIGN) {
      if (bgnatp < 4 | bgnatp == 6) {       # LINEAR or YEARLY
         call xaxlin (zstart, zperid, glabel(1), itics)
         }
      else {                                # LOGARITHMIC
         call xaxlog (1, zstart, zperid, itics)
         }
E 2
I 2
   if (bgbard(1) == BIGV) {
      call xtcpos (zistic, zietic)              # Set tic positions
      call ytcpos (zdstic, zdetic)   
E 2
      }
   else {
D 2
      type = bgpatp - 2
      if (type <= 0) type = type + 2
      call xaxper (type, zstart, zperid, zpnum, itics)
E 2
I 2
      call ytcpos (zistic, zietic)              # Set tic positions
      call xtcpos (zdstic, zdetic)   
E 2
      }
D 2
   if (bgdatp < 4) {                         # Dependent LINEAR
      call yaxlin (zdmin, zdmax, glabel(2), dtics)
E 2
I 2
   
   itics = bgntic
   if (bgaxis(1) == BIGP) {
      itics = 1
      if (bgptic(1) == BIGN) itics = 0
E 2
      }
D 2
   else {                                    # Dependent LOGARITHMIC
      call yaxlog (1, zdmin, zdmax, dtics)
      }
   }
else {
   if (bgaxis(1) == BIGN) {
      if (bgnatp < 4 | bgnatp == 6) {       # LINEAR or YEARLY
         call yaxlin (zstart, zperid, glabel(1), itics)
E 2
I 2
   dtics = bgdtic
   
   if (bgbard(1) == BIGV) {
      if (bgaxis(1) == BIGN) {
         if (bgnatp < 4 | bgnatp == 6) {       # LINEAR or YEARLY
D 3
            call xaxlin (zstart, zperid, glabel(1), itics)
E 3
I 3
            #call xaxlin (zstart, zperid, glabel(1), itics)
	    call gplinx (1, zstart, zperid, glabel(1), itics)
E 3
            }
         else {                                # LOGARITHMIC
D 3
            call xaxlog (1, zstart, zperid, itics)
E 3
I 3
            #call xaxlog (1, zstart, zperid, itics)
            call gplogx (1, 1, zstart, zperid, itics)
E 3
            }
E 2
         }
D 2
      else {                                # LOGARITHMIC
         call yaxlog (1, zstart, zperid, itics)
E 2
I 2
      else {
         type = bgpatp - 2
         if (type <= 0) type = type + 2
D 3
         call xaxper (type, zstart, zperid, zpnum, itics)
E 3
I 3
         #call xaxper (type, zstart, zperid, zpnum, itics)
         call gpperx (1, type, zstart, zperid, zpnum, itics)
E 3
E 2
         }
I 2
      if (bgdatp < 4) {                         # Dependent LINEAR
D 3
         call yaxlin (zdmin, zdmax, glabel(2), dtics)
E 3
I 3
         #call yaxlin (zdmin, zdmax, glabel(2), dtics)
         call gplinx (2, zdmin, zdmax, glabel(2), dtics)
E 3
         }
      else {                                    # Dependent LOGARITHMIC
D 3
         call yaxlog (1, zdmin, zdmax, dtics)
E 3
I 3
         #call yaxlog (1, zdmin, zdmax, dtics)
         call gplogx (2, 1, zdmin, zdmax, dtics)
E 3
         }
E 2
      }
   else {
D 2
      type = bgpatp - 2
      if (type <= 0) type = type + 2
      call yaxper (type, zstart, zperid, zpnum, itics)
E 2
I 2
      if (bgaxis(1) == BIGN) {
         if (bgnatp < 4 | bgnatp == 6) {       # LINEAR or YEARLY
D 3
            call yaxlin (zstart, zperid, glabel(1), itics)
E 3
I 3
            #call yaxlin (zstart, zperid, glabel(1), itics)
            call gplinx (2, zstart, zperid, glabel(1), itics)
E 3
            }
         else {                                # LOGARITHMIC
D 3
            call yaxlog (1, zstart, zperid, itics)
E 3
I 3
            #call yaxlog (1, zstart, zperid, itics)
            call gplogx (2, 1, zstart, zperid, itics)
E 3
            }
         }
      else {
         type = bgpatp - 2
         if (type <= 0) type = type + 2
D 3
         call yaxper (type, zstart, zperid, zpnum, itics)
E 3
I 3
         #call yaxper (type, zstart, zperid, zpnum, itics)
         call gpperx (2, type, zstart, zperid, zpnum, itics)
E 3
         }
      if (bgdatp < 4) {                         # Dependent LINEAR
D 3
         call xaxlin (zdmin, zdmax, glabel(2), dtics)
E 3
I 3
         #call xaxlin (zdmin, zdmax, glabel(2), dtics)
         call gplinx (1, zdmin, zdmax, glabel(2), dtics)
E 3
         }
      else {                                    # Dependent LOGARITHMIC
D 3
         call xaxlog (1, zdmin, zdmax, dtics)
E 3
I 3
         #call xaxlog (1, zdmin, zdmax, dtics)
         call gplogx (1, 1, zdmin, zdmax, dtics)
E 3
         }
E 2
      }
D 2
   if (bgdatp < 4) {                         # Dependent LINEAR
      call xaxlin (zdmin, zdmax, glabel(2), dtics)
      }
   else {                                    # Dependent LOGARITHMIC
      call xaxlog (1, zdmin, zdmax, dtics)
      }
   }
E 2
I 2
   }                        # END of maxpts loop
E 2

# Output all titles

call titlat (gfont(1), zchrsz(1), gcolor(1), 0., 2)
call byttoi (bgtitl, i)
call title (xtitle(1), ytitle(1), i, ntpray)

call titlat (gfont(2), zchrsz(2), gcolor(2), 0., 2)
call byttoi (bgsitl, i)
call title (xtitle(2), ytitle(2), i, ntpray)

if (bgbard(1) == BIGV) {
   call titlat (gfont(3), zchrsz(3), gcolor(3), 0., 8)
   call byttoi (bgitit, i)
   call title (xtitle(3), ytitle(3), i, ntpray)
   
   call titlat (gfont(3), zchrsz(3), gcolor(3), 0., 1)
   call byttoi (bgdtit, i)
   call title (xtitle(4), ytitle(4), i, ntpray)
   }
else {
   call titlat (gfont(3), zchrsz(3), gcolor(3), 0., 8)
   call byttoi (bgdtit, i)
   call title (xtitle(3), ytitle(3), i, ntpray)
   
   call titlat (gfont(3), zchrsz(3), gcolor(3), 0., 1)
   call byttoi (bgitit, i)
   call title (xtitle(4), ytitle(4), i, ntpray)
   }

# OUTPUT legends
if (bglgfg(1) == BIGY) {
D 6
   do i = 1, 5 {
E 6
I 6
   i = 1
   n = 1
   while (i <= 5) {
      if (bgadfg(1) == BIGY & i == bgadcv & bgaxis(1) != BIGP) { 
	 i = i + 1
	 }
E 6
D 4
      if (bgddef(i) > 0) {     # We have a curve
E 4
I 4
D 5
      if (bgddef(i) > 1) {     # We have a curve
E 5
I 5
      if (bgddef(i) > 0) {     # We have a curve
E 5
E 4
         # check for a legend
         j = (i-1)*21 + 1
         k = 0
         while (bgleng(j) != NUL) {
            k = k + 1
            ntpray(k) = bgleng(j)
            j = j + 1
            }
D 6
         call leglbl (i, k, ntpray)
E 6
I 6
         call leglbl (n, k, ntpray)
	 n = n + 1
E 6
         }
I 6
      i = i + 1
E 6
      }
   }

   return
end
E 1
