!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! @ l-old-box
!
! &1: action (label or nothing)
! &2: aaa
!
! Draw box and legends. p_box-setup must have been called before to ensure
! that this procedure works
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
if (.not.do%box) then
   return
endif
!
if ("&2none".ne."none") then
   ! Why this line? *** JP
   greg2\rgdata &2 /variable
endif
!
define character action*8 xlabel*1[2] ylabel*1[2]
let action "&1" /lower
!
! Label definition
if (action.eq."label") then
   let xlabel 'true%lab%xp[1]' 'true%lab%xp[2]'
   let ylabel 'true%lab%yp[1]' 'true%lab%yp[2]'
else
   let xlabel "n" "n"
   let ylabel "n" "n"
endif
!
! Box drawing: I. x axis
if ((true%coord.eq."rel").and.(true%lab%xu.ne."oth")) then
   ! The above condition is probably not generic
   greg1\axis xl /unit 'true%lab%xu' /label 'xlabel[1]'
   greg1\axis xu /unit 'true%lab%xu' /label 'xlabel[2]'
else if (true%lab%xu.eq."abs") then
   greg1\axis xl /abs /label 'xlabel[1]'
   greg1\axis xu /abs /label 'xlabel[2]'
else if (true%lab%xu.eq."pix") then
   greg1\axis xl true%prange%p[1,1] true%prange%p[2,1] /label 'xlabel[1]'
   greg1\axis xu true%prange%p[1,1] true%prange%p[2,1] /label 'xlabel[2]'
else
   greg1\axis xl /label 'xlabel[1]'
   greg1\axis xu /label 'xlabel[2]'
endif
! Box drawing: II. y axis
if ((true%coord.eq."rel").and.(true%lab%yu.ne."oth")) then
   ! The above condition is probably not generic
   greg1\axis yl /unit 'true%lab%yu' /label 'ylabel[1]'
   greg1\axis yr /unit 'true%lab%yu' /label 'ylabel[2]'
else if (true%lab%yu.eq."abs") then
   greg1\axis yl /abs /label 'ylabel[1]'
   greg1\axis yr /abs /label 'ylabel[2]'
else if (true%lab%yu.eq."pix") then
   greg1\axis yl true%prange%p[1,2] true%prange%p[2,2] /label 'ylabel[1]'
   greg1\axis yr true%prange%p[1,2] true%prange%p[2,2] /label 'ylabel[2]'
else
   greg1\axis yl /label 'ylabel[1]'
   greg1\axis yr /label 'ylabel[2]'
endif
!
! Legend printing
if (action.eq."label") then
   greg1\draw text 0 'true%leg%xp' 'true%leg%xt' 5  0 /char 2
   greg1\draw text 'true%leg%yp' 0 'true%leg%yt' 5 90 /char 4
endif
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
